I have the following table:
echo '<TABLE >';
echo '<TR valign=top>';
echo '<TD width=25 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center> #</div>';
echo '</div>';
echo '</TD>';
echo '<TD width=202 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center> Location</div>';
echo '</div>';
echo '</TD>';
echo '<TD width=60 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center>Time</div>';
echo '</div>';
echo '</TD>';
echo '<TD width=244 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center>Latest Activity</div>';
echo '</div>';
echo '</TD>';
$tot=0;
while ($EM = mysql_fetch_array($getEM)) {
$tot++;
$cID=strtolower(geoip_country_code_by_addr($gi,"$EM[totIP]"));
$cName=geoip_country_name_by_addr($gi, "$EM[totIP]");
$file=explode ("/",$EM[file]);
$num=count($file)-1;
if ($cID=="") {
echo '<TR valign=top>';
echo '<TD width=25 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center><BR>';
echo '2';
echo '</div>';
echo '</div>';
echo '</TD>';
echo '<TD width=202 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center><BR>';
if ($cID=="") {
echo '<img class="flag" src="http://www.alkhater.net/blog/addOns/visitors/flags/a1.gif" alt="flag" title=" Unkown " />';
} else {
echo '<img class="flag" src="http://www.alkhater.net/blog/addOns/visitors/flags/'.$cID.'.gif" alt="flag"/>';
$cName ;
}
echo '</div>';
echo '</div>';
echo '</TD>';
echo '<TD width=60 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center><BR>';
if ($EM[4]=="2144444444") {
$time=5;
echo "new";
} else {
$time=round(($EM[3]-$EM[4])/60);
echo $time;
}
echo '</div>';
echo '</div>';
echo '</TD>';
echo '<TD width=244 bgcolor="#C0C0C0">';
echo '<div class="wpmd">';
echo '<div align=center><BR>';
if ($file[$num]=="index.php") {
echo '<a class="ext" href="http://www.alkhater.net'.$EM[file].'" title=" go there ">Browsing the Main Page</a><br />';
} else {
if ($file[$num]=="") {
echo '<a class="ext" href="http://www.alkhater.net/index.php'.$EM[file].'" title=" look at the entry list ">Browsing by Month</a><br />';
} else {
$title=str_replace("_"," ",$file[$num]);
echo '<a class="ext" href="http://www.alkhater.net/index.php'.$EM[file].'" title=" go to entry: '.ucwords(strtolower($title)).' ">'.ucwords(strtolower($title)).'</a><br />';
}
}
echo '</div>';
echo '</div>';
echo '</TD>';
} }
echo '</TABLE>';
When I run it, the first row for the title shows ok.
But nothing inside the while loop.
I looked the page source trying of anything is echoed and find the same thing. Here is the line in the page source:
<br /><br /><TABLE >
<TR valign=top>
<TD width=25 bgcolor="#C0C0C0"><div class="wpmd"><div align=center> #</div></div></TD>
<TD width=202 bgcolor="#C0C0C0"><div class="wpmd"><div align=center> Location</div></div></TD>
<TD width=60 bgcolor="#C0C0C0"><div class="wpmd"><div align=center>Time</div></div></TD>
<TD width=244 bgcolor="#C0C0C0"><div class="wpmd"><div align=center>Latest Activity</div></div></TD></TABLE>
Any idea :!:
Thanks all,[/code]
Try changing this :-
mysql_fetch_array($getEM)
to this :-
$DB->get_results($getEM, ARRAY_A)
If that doesn't work then echo $getEM, and print_r($EM)
¥