Re: Inserting records question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>                 mysql_connect(localhost,$username,$password);
>                 @mysql_select_db("$database") or die("Unable to Connect to DB");
>                 $tc_query = "INSERT INTO $tablel VALUES(NULL, $lname, $fname, $machine_name,
> $email_addr, $problem, NULL)";
>                 $result = mysql_query($tc_query);

It's always nice to check if the query even ran, using "or
die(mysql_error())".  You might also want to print out the query
itself to see if there are missing values.  Perhaps you're relying on
register globals, which is turned off?

$result = mysql_query($tc_query) or die(mysql_error() . " in the query
$tc_query";

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux