RE: [PHP-DB] sql errors?
| From: | N dot A dot Morgan at bton dot ac dot uk | Date: | Tue, 16 Dec 2003 08:32:33 +0000 |
| Subject: | RE: [PHP-DB] sql errors? | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-32069@lists.php.net to get a copy of this message | ||
is register_globals set to off in php.ini?
this may be the issue if it is set to on.
-----Original Message-----
From: Jas [mailto:jason.gerfen@scl.utah.edu]
Sent: 15 December 2003 22:50
To: php-db@lists.php.net
Subject: [PHP-DB] sql errors?
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
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php