RE: [PHP-DB] Nothing returned

From: Date: Sun, 04 Nov 2001 06:02:45 +0000
Subject: RE: [PHP-DB] Nothing returned
References: 1 2  Groups: php.db 
Request: Send a blank email to php-db+get-13983@lists.php.net to get a copy of this message
Peter Lovatt wrote: > $sql = "SELECT * FROM users WHERE (name='$name')" > > if you are not getting an error, it is usually worth echoing the query SQL > > echo $sql ; > > and perhaps trying it manually. > > Is it possible the quotes around the $name are giving > > SELECT * FROM users WHERE (name='$name') > and not evaluating $name > > rather than > > SELECT * FROM users WHERE (name='fred') > > which you wanted echo $sql gives me: SELECT * FROM users WHERE (name='admin') when entering admin as user. So the name is passed to the function but from then on ... M.

« previous php.db (#13983) next »