Hi I have a url to an image in my database and I want to call it to a page. It is going to be a random call, but for now I've only got one in. I can get the url to echo to the page, but can't get the image. I have done this before, but for the life of me, I can't rmember how. Here is my code: $sql=mysql_query("SELECT myurl FROM thumbsurl ORDER BY RAND() LIMIT 1"); while(@$row=mysql_fetch_array($sql)){ //Build formatted result here ("<h5>"); $myurl=$row["myurl"]; echo $row['myurl']; echo "<img src=$myurl>"; } PHP: I have been going around in circles with this and seem to be getting nowhere. Any help would be appreciated Harlequeen
I Haven't understood your code, But i would do it like that : $sql=mysql_unbuffered_query("SELECT `myurl` FROM `thumbsurl` ORDER BY RAND() LIMIT 1"); $row = mysql_fetch_array($sql); echo "<img src=\"{$row['myurl']}\">"; PHP: Hope it works