Could everyone help please. 😕
I encountered a strange problem recently. I have a table that stores html coded adverts in TEXT column type. All the adverts are written like "<A><IMG></A>" I uses one the table column to store last view time, mysql query loads the advert ordered by last view time, so advert shown is different each time. (I dont think this matters to my problem.) The STRANGE problem is now some times it loads the advert with only "<A></A>" part, the middle part "<IMG>" went missing, not only is IMG tag, some of the advert uses flash, they also go missing. So at the end I get a blank A link.
[code=php]$sql = "select id, html as ad_html, lastview from ads_top where TO_DAYS(expire_date)>=TO_DAYS(NOW()) order by lastview limit 1";
$pass=0;
$try_count=0;
do {
if ($res = mysql_query($sql)) {
if ($row=mysql_fetch_object($res)) {
if ($row->ad_html!="") {
echo "<!--AUTO AD BEGIN ID: $row->id -->\n";
echo stripslashes($row->ad_html);
echo "<!--AUTO AD END-->\n";
$newtime = time();
mysql_query("update ads_top set lastview = $newtime where id=$row->id");
$pass=1;
$try_count++;
}
mysql_free_result($res);
}
}
if (($pass==1)||($try_count>=3)) break;
} while (1);[/code]
the website is : http://www.sagitta-tvl.com/index_new.php