Re: Resource id #5
| From: | Stut | Date: | Thu, 27 Mar 2008 18:14:00 +0000 |
| Subject: | Re: Resource id #5 | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-44838@lists.php.net to get a copy of this message | ||
On 27 Mar 2008, at 17:51, Richard Dunne wrote:
Can someone explain how I can translate Resource id #5 which is what I am getting from the code below? $result = mysql_query("Select answer from answers") or die(mysql_error()); $resultArray = explode(',',$result); for ($i=0;$i<sizeof($resultArray);$i++) { echo $resultArray[$i]; }For the love of $DEITY, please read the frickin' manual: http://php.net/mysql. You've been asking similar questions around this topic for the past few days and you clearly haven't moved forward in your understanding. The mysql_query function returns a resource. If you print a resource you get the text "Resource id #n" where n is replaced with its ID. To make use of this resource you need to use functions like mysql_fetch_array, mysql_fetch_assoc or one of the many others detailed in, you guessed it, the manual. Try it, you might like it. -Stut -- http://stut.net/