Re: Inserting records question
| From: | Scott Noyes | Date: | Fri, 09 Sep 2005 01:42:19 +0000 |
| Subject: | Re: Inserting records question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-222060@lists.php.net to get a copy of this message | ||
> 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";