Jump to content

Quick sql question


leisnerr

Recommended Posts

mysql_query("INSERT INTO Person (FirstName, LastName, Age)
VALUES ('$_POST[firstname]', '$_POST[lastname]', '$_POST[age]')");

if (!mysql_query($sql,$con))          
{
die('Error: ' . mysql_error());
}
echo "Information Added";

 

$sql is not defined. In my version I define $sql then call mysql_query().

 

You call mysql_query() then try to call it again with an undefined query string

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.