Jump to content

Undefined property: stdClass...


evanct

Recommended Posts

I'm getting this error:

 

Notice: Undefined property: stdClass::$tn_src in C:\Apache2\htdocs\gallery\functions.php on line 9

 

here's the code:

 

function getPhotos() {
include('login.php');
$query="SELECT id,src FROM photos ORDER BY id desc";
$result=mysql_query("$query");
if($result) {
while ($row=mysql_fetch_object($result)) {
$tn_src=$row->tn_src;
$src=$row->src;
$id=$row->id;

echo '<li style="display:inline;">
<a href="view_image.php?id='.$id.'"><img src="'.$tn_src.'" alt="images" id="'.$id.'" /></a>
</li>';

}
}
}

 

line 9 is

$tn_src=$row->tn_src;

 

i've tried googling it, can't find a straight answer. anyone know what's going on?

Link to comment
https://forums.phpfreaks.com/topic/139947-undefined-property-stdclass/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.