RE: [PHP] SELECT statement
| From: | Philip Olson | Date: | Tue, 13 Feb 2001 05:59:14 +0000 |
| Subject: | RE: [PHP] SELECT statement | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-39359@lists.php.net to get a copy of this message | ||
A possible way to find out :
$result = mysql_query($sql) or die(mysql_error());
Does it say anything? mysql_error() is your friend, it can be printed
anywhere within the script and will print the last mysql error. So
perhaps :
print mysql_error();
Right before the query or ...
Regards,
Philip
On Tue, 13 Feb 2001, Peter Houchin wrote:
>
>
>
>
> ok I've changed my code to
>
> $sql = "SELECT id, email FROM users WHERE user='$user' and
> pass='$pass'";
> but still no joy can any one suggest why?
>
> (& Yes email is a field in the table)
>
> Peter
>
> > Hi,
> >
> > Can you have a SELECT statement (using mysql) that goes something like
> >
> > $sql="SELECT id && email FROM table WHERE user='$user' and
> > pass='$pass'";
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
> For additional commands, e-mail: php-general-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>