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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.