hi i am having truble with my site scripters, coz in the Categories section only two Categories are being listed instead of there in my database.
in my database i have a cols called id(thats just the Categories id, dir(this is the Categories name), lang(thats the lang of where the Categories),info(thats info about the Categories) and lang_id(this is a number that represents the lang like php is 1 ect, ect).
this is the code can u please check to see if its the code or the database.
<?php
if (!$_GET[lang]) {
header("Location: $REFERER");
exit;
}
//connect to server and select database
$conn = mysql_connect("localhost", "smallbad", "****") or die(mysql_error());
mysql_select_db("smallbad_scripters",$conn) or die(mysql_error());
//get the dirs
$sql = "select * from dir where lang_id=$_GET[lang]";
$rs= mysql_query($sql,$conn) or die(mysql_error());
if (mysql_num_rows($rs) < 1) {
//there are no dirs
$display_block = "<P><em>No Categories exist.</em></p>";
} else {
$lang = stripslashes(mysql_result($rs,0,'lang'));
$display_block = " <table>";
//get the dirs infomation
while ($row = mysql_fetch_array($rs)) {
//if they do
$display_block .= "
<tr>
<td>
<table width=100% cellpadding=3 cellspacing=0 border=1 bordercolor=#FFFFFF>
<tr>
<td bordercolor=red width=150px bgcolor=#FFFFFF><center><b><font size=4>".$row[dir]."</font> </b></center></td>
<td bordercolor=red><center><table width=70%><tr><td bgcolor=#FFFFFF><b><font size=4>".$row[info]."</font> </b></td></tr></table></center></td>
</tr>
</table>
</td>
</tr>";
}
$display_block .= "</table>";
}
?>
thank you all for that can/will help & i hope you had a happy new year.