evanct Posted January 8, 2009 Share Posted January 8, 2009 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? Quote Link to comment Share on other sites More sharing options...
evanct Posted January 8, 2009 Author Share Posted January 8, 2009 bump? Quote Link to comment Share on other sites More sharing options...
dclamp Posted January 8, 2009 Share Posted January 8, 2009 $row is not a class. It is an array. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.