When I try to submit my form it doesn't enter the data into the database. My page also shows this message: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in .... line 18 Line 18 is marked below in the code. Aside the code being dated, I can't get a handle on what to do to solve it. Can someone please help me out?
error_reporting (2039);
extract($_GET);
extract($_POST);
$server = "server.com";
$username = "uname";
$password = "pword";
$database = "mydb";
$db = @mysql_connect($server,$username,$password);
mysql_select_db($database);
if($submit =="save")
{
$sales = addslashes($sales);
$billing = addslashes($billing);
$support = addslashes($support);
$query = mysql_query("update variables set sales ='$sales', billing='$billing', support ='$support' where id = 1");
}
$query = mysql_query("select sales, billing, support from variables");
$row = mysql_fetch_array($query, MYSQL_ASSOC); // line 18
$sales = stripslashes($row['sales']);
$billing = stripslashes($row['billing']);
$support = stripslashes($row['support']);