Query/Error
| From: | Anthony Rodriguez | Date: | Fri, 17 May 2002 09:35:51 +0000 |
| Subject: | Query/Error | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98033@lists.php.net to get a copy of this message | ||
I've a php script that creates (inserts) a new record in a MySQL table. It executes, goes to the next page, but it doesn update the db>
The db name and table name are OK. I've printed the values passed to the script and it's OK too.
What code can I add to the script to find out the error of the query?
Here's the script:
<?php
$connection=@mysql_connect("localhost","wagner","xyz") or die ("No connection!");
$db=@mysql_select_db("sbwresearch_com",$connection) or die ("No database!");
$qry_1="insert into scr_149
(
username,
e_mail,
q01a,
...
q07a,
date_done
)
values
(
'$username',
'$e_mail',
'$q01a',
...
'$q07a',
'$date_done'
)"
or die ("No query #1!");
$result_1=@mysql_query($qry_1,$connection);
@mysql_close($connection);
header ("location:scr_6.htm");
flush();
exit;
?>