Re: insert - hours of time - help

From: Date: Sun, 11 Feb 2001 01:50:27 +0000
Subject: Re: insert - hours of time - help
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-6532@lists.php.net to get a copy of this message
It looks like you are getting a error in your INSERT statement and not catching it. The statement is not correct, missing ' on the values line..: > $query="INSERT INTO table values('$last_name)"; ^ closing ' here... Change it to: $query="INSERT INTO table values('$last_name')"; It always a good idea to catch errors, at least while developing...if you dont want to see the errors, maybe email them to yourself.. /cody Marc Bragg wrote: > Help, > > I have a data input form which collects information from users, and then > transmits to a page for user to view. How do I pass the input date into > the table. Have tried the following: > > input.php3 > <form name='frmAttyApp' method=post action="app.php3"> > > Please enter your last name (<i>required</i>): > <input name="last_name" type="text"> > <br> > </form> > > This then displays to user through app.php3: > <?php > echo ( > "<b>Thank You for submitting the following:</b><br>Please double check > your answers.<br>Please click back and fix any errors prior to > submitting." . NL . NL . // new line constant. > "Last Name: $last_name" . NL > ) > > <form method=post action="attydb.phtml"> > <?php > "$last_name, > </form> > > This then hits the attdb.phtml and phtml does connect to the database as > follows: > --attydb.phtml-- > > <?php > mysql_connect(localhost, test); > @mysql_select_db(trial) or die("Unable to select database"); > $query="INSERT INTO table values('$last_name)"; > $result=mysql_query($query); > mysql_close(); > > ?> > > >From my logs, I am connecting fine to the database. But the information > in the last_name is not being passed to the database. The app.php3 > displays only as follows when brought into the browser: > > Last Name: Bragg<br> > > How do I retain the $last_name information so it passes to the database > and at the same time displays in the browser so user can be sure entry > is correct? Or, how do i pass the input to the database in the first > place? > > Thanx > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net > For additional commands, e-mail: php-db-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.db (#6532) next »