Re: Resource ID# 5 and Resource id #5 8561 errors....help

From: Date: Fri, 12 Dec 2008 22:52:54 +0000
Subject: Re: Resource ID# 5 and Resource id #5 8561 errors....help
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-284567@lists.php.net to get a copy of this message
On Fri, Dec 12, 2008 at 4:02 PM, Daniel P. Brown <daniel.brown@parasane.net>wrote: > On Fri, Dec 12, 2008 at 16:54, Terion Miller <webdev.terion@gmail.com> > wrote: > > > > $query = "SELECT * FROM importimages WHERE Category='Obits' "; > > $result = mysql_query ($query); > > > > $arr = mysql_fetch_row($result); > > $result2 = $arr[0]; > > echo ($result2); > > Try this to get yourself started: > > <?php > $sql = "SELECT * FROM importimages WHERE > Category = 'Obits'"; > $result = mysql_query($sql) or die("Error in ".__FILE__.":".__LINE__." > - ".mysql_error()); > while($row = mysql_fetch_array($result)) { > foreach($row as $k => $v) { > echo stripslashes($k).": ".stripslashes($v)."<br />\n"; > } > } > ?> > > NOTE: You shouldn't need stripslashes(), but it's put there just > for backwards-compatibility in case you're on an older (or > poorly-configured) installation. > > -- > </Daniel P. Brown> > http://www.parasane.net/ > daniel.brown@parasane.net || danbrown@php.net > 50% Off Hosting! http://www.pilotpig.net/specials.php > Thanks Daniel that did get me further, am I now to build an object from the array, or take off one of the array to make an object, your snippet did grab the names of the images and print them to the page but then I get stuck where the page is trying to "get the property of a non-object" ..so I guess i"m asking is a possible to turn an array into an object? or in this case separate objects?

« previous php.general (#284567) next »