sql errors?

From: Date: Mon, 15 Dec 2003 22:49:31 +0000
Subject: sql errors?
Groups: php.db 
Request: Send a blank email to php-db+get-32059@lists.php.net to get a copy of this message
I have checked and rechecked my code on these php to mysql statements and for some reason I either get no data (through php, where through a command line I get all the data I need) or errors on the update function. Could someone tell me what I am doing wrong? $sql = mysql_query("SELECT hostname FROM $table WHERE vlan = $_POST[dhcp_hosts]",$db)or die(mysql_error()); from the command line SELECT hostname FROM hosts WHERE vlan = 'Vlan-22'; And I get results... I don't get it. And for the update statement I am having problems with... $sql_global = mysql_query("UPDATE $tble SET dn = '$_POST[dn]' SET lt = '$_POST[lt]' SET mlt = '$_POST[mlt]' SET msc01 = '$_POST[msc01]' SET msc02 = '$_POST[msc02]' SET msc03 = '$_POST[msc03]' SET msc04 = '$_POST[msc04]' WHERE id = '1'",$db)or die(mysql_error()); If you echo the posted vars they are all present and the same statement works in other places of the script and from the command line. Any help is appreciated. Jas

« previous php.db (#32059) next »