Re: query works in mysql, but not from php
| From: | Christian Dechery | Date: | Mon, 19 Nov 2001 23:09:17 +0000 |
| Subject: | Re: query works in mysql, but not from php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-75176@lists.php.net to get a copy of this message | ||
remove the ";" at the end...
mysql_query() doesn't need it... since it only executes on atomic command, the ";" is useless..
that's what's causing the error...
At 22:58 19/11/01 +0000, Olav Drageset wrote:
Hi $sql = "SELECT user FROM persons WHERE user = '$firstName' and domain = '$domainName' ; "; $result = mysql_query($sql,$connection ) or die(mysql_error());_____________________________ . Christian Dechery . . Gaita-L Owner / Web Developer . . http://www.webstyle.com.br . . http://www.tanamesa.com.brCalling above lines from php returns: You have an error in SQL syntax near ';' at line 1Issuing the command SELECT user FROM persons WHERE user = 'fred' AND domain = 'company.net' ; in mysql give a proper result. Can anyone explain what might be causing the error??? regards Olav -- 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