I have this code that is in a php widget to go and gather up to 5 random images.
But it's placing the images in the header instead of the php box.
Any ideas on why that's happening?
I did notice all this code is "msql" and my db is "mysqli" not sure if that matters?
Code:
$con = mysql_connect("*****.**.*******.hostedresource.com","*******","******");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("******", $con);
$result = mysql_query("SELECT * FROM vjb_ads ORDER BY RAND() LIMIT 0,5;");
while($row = mysql_fetch_array($result))
{
echo "<a href='{$row['url']}'><img src='{$row['image_path']}' /></a><br/>";
}
mysql_close($con);