Assuming you can feed 'admin' into the function and it works, but feeding 'fred' doesn't, it looks like there is a problem with the data.
Starting with the obvious that you have probably already covered 1. Is the data in the database at all - could there have been a problem inserting it? 2. Has it been entered correctly, not forgetting case sensitivity 3. Could there be any invisible chars (space or tab for example) in the data. I had a script that generated entries and I accidentally left a space at the beginning of the field. Took me hours to realise because it isn't immediately obvious! Worth a browse through with some sort of management tool, such as phpMyAdmin http://www.phpwizard.net/projects/phpMyAdmin/ if you haven't already. Not sure otherwise. HTH Peter > -----Original Message----- > From: Martin [mailto:[EMAIL PROTECTED]] > Sent: 04 November 2001 06:03 > To: [EMAIL PROTECTED] > Subject: RE: [PHP-DB] Nothing returned > > > 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. > > -- > PHP Database Mailing List (http://www.php.net/) > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]