Jump to content

Deprecated: mysql_db_query()


redgunner

Recommended Posts

I am having difficulties in resolving this issue...

 

Deprecated: mysql_db_query() [function.mysql-db-query]: This function is deprecated; use mysql_query() instead

 

I do what it asks and then I get the following error message...

 

ERROR: INSERT INTO customers (name, age) VALUES ('', 'Joe' '40') Added Show Records

 

if ($_SERVER['REQUEST_METHOD'] == "POST") {

// Form Values
$id = "";
$name = $_POST['name'];
$age = $_POST['age'];

$SQL = " INSERT INTO customers ";
$SQL = $SQL . " (name, age) VALUES ";
$SQL = $SQL . " ('$id', '$name' '$age') ";
$result = mysql_db_query($database,"$SQL");

if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n"); } echo ("Added\n"); }

 

Thanks for any help in advance...

Link to comment
https://forums.phpfreaks.com/topic/211628-deprecated-mysql_db_query/
Share on other sites

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.