In the past I had this query
$query="select imag_url from inventy where shop='".$shop."' and qty>='".$cnfig['shop_min_qty']."' and cat='".$row3->cat."' and imag_url!='' order by rand() limit 1";
Using this result/row
$row = mysql_fetch_object($result);
echo $row->imag_url
and it worked fine. I convert it to use the same query with this row/result
$row=$result->fetch_object;
echo $row->imag_url
and I get no imag_url echoed back. I can test the row exists with $result->num_rows and I get '1' but can't get anything out of the row.
I finally got it to work by using
$row=$result->fetch_row();
echo $row[0];
I've got the $result->fetch_object in other places fetching only one row and it works. Can anyone tell me why it wouldn't work here? Is there something to do with the selecting one at random? This one has me really confused and I'd really like to know why.:queasy: