My proplem is when i made this function ... i want to use Dynamic HTML Tags .. so i dont want to define it in my function
so when i ran the while loop .. there aren't result .....
so please any one can help me ????
<table width="100%" border="2" style="border-collapse: collapse" bordercolor="#000000" cellpadding="0" cellspacing="0">
<tr>
<td bgcolor="#EEEEEE"><p align="center"><font face="Tahoma" size="2">ÈÑíÏ
ÇáÖÍíÉ</font></td>
<td bgcolor="#EEEEEE"><p align="center"><font face="Tahoma" size="2"> ÇáÑÞã
ÇáÓÑí</font></td>
<td bgcolor="#EEEEEE"><p align="center"><font face="Tahoma" size="2"> ÇÓã
ÇáãÑÓá</font></td>
<td bgcolor="#EEEEEE"><p align="center"><font face="Tahoma" size="2"> ÇáÈÑíÏ
ÇáÅáíßÊÑæäí</font></td>
<td bgcolor="#EEEEEE" dir="ltr"><p align="center"><font face="Tahoma" size="2">
ÇáÊÇÑíÎ</font></td>
<td bgcolor="#EEEEEE"><p align="center"><font face="Tahoma" size="2">
ÇáãáÇÍÙÇÊ</font></td>
</tr></td>
<?
include "db.php";
function page_div($sql, $pagelimit, $color1, $color2){
global $pagenums, $totalrows, $start, $starting_no, $end_count, $space, $query, $strSQL, $var2, $i, $row_color, $row_count, $page, $contine;
$query = mysql_query($sql);
$totalrows = mysql_num_rows($query);
$pagenums = ceil ($totalrows/$pagelimit);
if ($page=='') {
$page='1';
}
$start = ($page-1) * $pagelimit;
$starting_no = $start + 1;
if ($totalrows - $start < $pagelimit) {
$end_count = $totalrows;
} elseif ($totalrows - $start >= $pagelimit) {
$end_count = $start + $pagelimit;
}
if ($totalrows - $end_count > $pagelimit) {
$var2 = $pagelimit;
} elseif ($totalrows - $end_count <= $pagelimit) {
$var2 = $totalrows - $end_count;
}
$space = " ";
// run query again using LIMIT
$strSQL = mysql_query("$sql LIMIT $start,$pagelimit");
$contine = True ;
if (mysql_num_rows($strSQL) == '0') {
echo("Nothing to Display Or You choosed wrong number of pages !");
$contine = false ;
} elseif ($contine = True) {
// row colors
$row_color="$color1";
$count_rows = "0";
while ($row = mysql_fetch_array($strSQL)) {
$count_rows++;
if ($count_rows%2==0)
{ $row_color="$color1"; } // Even-numbered rows
else
{ $row_color="$color2"; } // Odd-numbered rows
echo "<tr>
<td bgcolor=\"$row_color\" dir=\"ltr\"><p align=\"center\"><font face=\"Tahoma\" size=\"2\"> $row[vic_mail]</font></td>
<td bgcolor=\"$row_color\" dir=\"ltr\"><p align=\"center\"><font face=\"Tahoma\" size=\"2\"> $row[PASSWORD]</font></td>
<td bgcolor=\"$row_color\"><p align=\"center\"><font face=\"Tahoma\" size=\"2\"> $row[my_name]</font></td>
<td bgcolor=\"$row_color\"><p align=\"center\"><font face=\"Tahoma\" size=\"2\"> $row[my_mail]<br> $my_rmail</font></td>
<td bgcolor=\"$row_color\" dir=\"ltr\"><p align=\"center\"><font face=\"Tahoma\" size=\"2\"> $row[date]</font></td>
<td bgcolor=\"$row_color\"><p align=\"center\"><font face=\"Tahoma\" size=\"2\"> $row[comments]</font></td>
</tr>";
}
echo "</table>";
echo "</tr>";
echo "</table>";
}
// next link
if ($page<$pagenums) {
echo (" <a href='$PHP_SELF?page=".($page+1)."' class=main>ÇáÊÇáí" . $space ." </a>");
}
// dynamic page number links
for ($i=1; $i<=$pagenums; $i++) {
if ($i!=$page) {
echo " <a dir='rtl' href='$PHP_SELF?page=$i' class=main>$i</a>";
}
else {
echo " <b class='red'>$i</b>";
}
}
//previous link
if ($page>1) {
echo "" . $space ." <a href='$PHP_SELF?page=".($page-1)."' class=main>ÇáÓÇÈÞ</a>";
}
else () {
echo "There Was an erorr in choosing the pages" ;
}
}
page_div("SELECT * FROM noemails WHERE status='1' ORDER BY stamp DESC", "5", "#FFFFFF", "#E9E9E9") ;