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

From: Date: Fri, 12 Dec 2008 22:02:18 +0000
Subject: Re: Resource ID# 5 and Resource id #5 8561 errors....help
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-284566@lists.php.net to get a copy of this message
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

« previous php.general (#284566) next »