RE: [PHP-DB] mysql not valid resource

From: Date: Tue, 09 Aug 2005 13:46:54 +0000
Subject: RE: [PHP-DB] mysql not valid resource
Groups: php.db 
Request: Send a blank email to php-db+get-40044@lists.php.net to get a copy of this message
Marco, Have you tried echoing out the sql statement to the browser before it gets sent to the database? That would show you the exact query string and give you a chance to see where the error might reside. $sql="select distinct des_riga, count ( des_riga ) as freq from k_riga where id_tabella=" . $id_tabella . " and id_colonna=" . $id_colonna . " group by des_riga order by des_riga"; echo $sql //ADD THIS LINE // COMMENT THIS OUT FOR NOW $query=mysql_query ($sql, $connessione); Rich -----Original Message----- From: Marco Strullato [mailto:marco.strullato@gmail.com] Sent: Tuesday, August 09, 2005 9:44 AM To: php-db@lists.php.net Subject: [PHP-DB] mysql not valid resource Hi all, I have a problem with mysql: this code produce a not valid mysq resource. $sql="select distinct des_riga, count ( des_riga ) as freq from k_riga where id_tabella=" . $id_tabella . " and id_colonna=" . $id_colonna . " group by des_riga order by des_riga"; $query=mysql_query ($sql, $connessione); $id_tabella, $id_colonna and $connessione has the correct value... The same query runs perfectly if I exec it directly on the db. Do you have any suggestions? Marco -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

« previous php.db (#40044) next »