Re: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in f:\.....\none.php on line 286

From: Date: Mon, 09 Jun 2003 16:28:21 +0000
Subject: Re: Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in f:\.....\none.php on line 286
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-150763@lists.php.net to get a copy of this message
On Mon, 9 Jun 2003 07:35:16 -0300 mlaia@fcav.unesp.br (Marcelo Luiz De Laia) wrote: > I use phpnuke and it have a sql_layer.php. You are correct, for mysql is > mysql_query. But this dont is the problem, I change it and the problem > continue! > > Any tip?? I think you are mixing the layer and native functions. You should use ONE of these, either the layer from phpnuke OR the native functions. I don't know how the layer handles the results but from the layout you had it looks just wrong. The "standard"-way using native mysql_*-functions for a select (with some basic error checking) is as follows: [... connection and so on ...] $result = mysql_query("select * from ..."); if(!mysql_error()) { echo mysql_error(); } while($row=mysql_fetch_row($result)) { [... output ...] } You are either not transferring the result-identifier correctly or your query returns an error. Thomas

« previous php.general (#150763) next »