[SOLVED] Must be really blind
Posted: Wed Jul 07, 2004 3:20 am
Cant seem to find why i have this error
in thisNotice: Undefined variable: query
$query infront of INSERT
Code: Select all
$host = 'localhost';
$usr = 'root';
$pwd = '';
$db = 'testdb';
$link =mysql_connect($host, $usr, $pwd)
or die ( "Execute error: " .mysql_error());
$dbconnect = mysql_select_db($db, $link);
$query = "INSERT INTO test (code,name,amt,inv_num,check_num,date) VALUES (".$_POST['code'].",".$_POST['name'].",".$_POST['amt'].",".$_POST['inv_num'].",".$_POST['check_num'].",".$_POST['date'].")";
}
$result = mysql_query($query) or die(mysql_error());
if (!$query)
{
die ("DB prolly down, you might wanna email the site admin");
}