Re: Resource ID# 5 and Resource id #5 8561 errors....help
| From: | Daniel P. Brown | Date: | Fri, 12 Dec 2008 23:08:58 +0000 |
| Subject: | Re: Resource ID# 5 and Resource id #5 8561 errors....help | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284569@lists.php.net to get a copy of this message | ||
On Fri, Dec 12, 2008 at 18:03, Terion Miller <webdev.terion@gmail.com> wrote:
>
> Well I did some changes and I must be learning because although I have the
> same error I don't have new ones...
> so now the code is like this:
> $sql = "SELECT * FROM
importimages WHERE
> Category = 'Obits'";
> $result = mysql_query($sql) or die("Error in ".__FILE__.":".__LINE__."
> - ".mysql_error());
> while($object = mysql_fetch_object($result)) {
> foreach($object as $k => $v) {
> echo stripslashes($k).": ".stripslashes($v)."<br />\n";
> }
> }
>
>
> $FileName = $object->Image; <-------This is the line that is telling
> me it is "trying to get the properties of a non-object....
That's because you're calling that as an object using OOP
standards, where I gave you procedural code. To interface with my
code, just call it as:
<?php
// .... other code here....
while($row = mysql_fetch_array($result)) {
echo $row['Image']."<br />\n"; // If Image is the column
name.
}
// .... code continues....
?>
--
</Daniel P. Brown>
http://www.parasane.net/
daniel.brown@parasane.net || danbrown@php.net
50% Off Hosting! http://www.pilotpig.net/specials.php