[thelist] re: mySQL INSERT query failing...

Edwin Martin edwin at bitstorm.org
Fri Jun 18 03:35:18 CDT 2004


Tom Dell'Aringa wrote:

> I get a '-1' which apparently indicates query failure:
> 
> But I still have no idea why...

I good way I often use to find out what's going on is to use 
print_r():

So if you do this:

$conn = mysql_connect($hostname, $dbusername, $dbpassword);

$result = mysql_query("INSERT INTO ...);

You can find errors and such with:

print_r( $conn );

and

print_r( $result );

Take a look in the source for nicely formatted output or do 
a print "<pre>\n"; before the print_r().

Edwin Martin.




More information about the thelist mailing list