below you will find the code i am using to
input data to a database i just created.
i am just a neebie and picked up a book and
am trying to learn php. the problem is whenever i use the script below i get the following warning.
"Warning: mysql_db_query is deprecated; use mysql_select_db() and mysql_query() instead"
my question is what does it mean when it says deprecated? also what is the correct syntax to use the 2 other option i am given?
thanks
Bill
<?PHP
/ This page receives and handles the data
generated by "index.php" . /
// Trim the incoming Data
$Array["FirstName"] = trim
($Array["FirstName"]);
$Array["LastName"] = trim
($Array["LastName"]);
$Array["Email"] = trim
($Array["Email"]);
$Array["Comments"] = trim
($Array["Comments"]);
// Set Variables for the Database
$Host = "localhost";
$User = "administrator";
$Password = "commander";
$DBName = "FirstDB";
$TableName = "Information";
// Make the connection to the Database
$Link = mysql_connect ($Host, $User, $Password);
// Make the SQL Insert Query
$Query = "INSERT into $TableName values
('0', '$Array[FirstName]',
'$Array[LastName]',
'$Array[Email]',
'$Array[Comments]')";
// Show Query to user
Print ("The Query is: <br><b>$Query</b><p>\n");
// If statement begins for success or failure of the SQL Query Update
if (!mysql_db_query ($DBName, $Query, $Link)) {
Print ("<b>The Query was successfully executed!</b><br>\n");
} else {
Print ("<b>The Query could not be executed!</b><br>\n");
}
// Close the connection to the Database
mysql_close ($Link);
?>