Re: query works in mysql, but not from php

From: Date: Mon, 19 Nov 2001 23:03:05 +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-75175@lists.php.net to get a copy of this message
On Lun 19 Nov 2001 19:58, Olav Drageset wrote: > Hi > > $sql = "SELECT user FROM persons WHERE user = '$firstName' and domain = > '$domainName' ; "; $result = mysql_query($sql,$connection ) or > die(mysql_error()); > > Calling above lines from php returns: You have an error in SQL syntax > near ';' at line 1 Through away the semicolon (;), that only tells the MySQL interpreter that the quiery should be executed. In PHP, each call to the query function executes it. Saludos... :-) -- Porqué usar una base de datos relacional cualquiera, si podés usar PostgreSQL? ----------------------------------------------------------------- Martín Marqués | mmarques@unl.edu.ar Programador, Administrador, DBA | Centro de Telematica Universidad Nacional del Litoral -----------------------------------------------------------------

« previous php.general (#75175) next »