On Tuesday 26 February 2002 02:31, Chiew, Richard wrote:
> I have the following php code to asks for a new student to fill out a
> registration form. Using php, take what the user enters and put it into
> the "students" table. But when i select * from students in mysql, it
> didn't show, why?
>
> <HTML>
> <BODY bgColor=#ffffff>
> <?php
> if ($submit) {
> // process form
> $db = mysql_connect ("localhost", "root", "mollier");
> $select=mysql_select_db ("mydb");
> $sql = "INSERT INTO students
> (student_id, firstname,lastname, address) VALUES
> ('$student_id', '$firstname', '$lastname', '$address')";
> $result = mysql_query($sql);
> echo "Thank you! Information entered.\n";
Try adding some debug code. Look at the examples in the manual chapter
"MySQL functions".
echo $sql to see what it contains.
--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
/*
Your picture of the world often changes just before you get it into focus.
*/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php