Re: warning

From: Date: Tue, 17 Oct 2000 13:21:17 +0000
Subject: Re: warning
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20616@lists.php.net to get a copy of this message
At 7:47 AM -0400 10-17-2000, tony wrote:
?Hello people! I have a problem with mysterious warning.. I have following code: $sql = "select * from some_table where ID=$ID"; $results = mysql_query($sql); $array = mysql_fetch_rows($results); . . . above code is working perfectly, but it gives following warning: Warning: Supplied argument is not a valid MySQL result resource in ./mysql.php3 on line 166 I can't seem to find anything wrong.. Please let me know if you have encountered such warning. Again, the code seems to be working fine and generating correct outputs.
It's difficult to diagnose your code because: 1) You're not really showing us your code, you're showing us something you typed into the message yourself (there is no function mysql_fetch_rows(), but that doesn't match the error you're receiving). 2) You didn't tell us which line is line 166. 3) There isn't any error checking. Learn to use mysql_error() and mysql_errno(), they're really very helpful. It's possible the message you're receiving isn't from the above fragment of code at all. Especially if, as you say, it seems to be working perfectly. -- Paul DuBois, paul@snake.net

« previous php.general (#20616) next »