Location: PHPKode > projects > PHP Simple FAQ > phpsimplefaq1.1beta/phpsimplefaq/includes/faq_index.inc.php
<? // PHP Simple FAQ Index page v1.0 ?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
	<tr valign="top" align="left">
		<td><? echo "<font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\">" ?>
			<center><b><? echo "$main_title"; ?></b></center></font>
		</td>
	</tr>
</table>
<br>
<table width="90%" cellpadding="4" cellspacing="2" bgcolor="#333366">

<?
	
$get_faqs = "SELECT *
			 FROM $database_name.$faq_table";
$faq_result = mysql_query($get_faqs,$connection);
while ($myrow1 = mysql_fetch_array($faq_result)) 

	{
		$the_faq = $myrow1["faq_title"];
		$faq_id = $myrow1["faq_id"];
		echo "<tr>\n";
		echo "<td bgcolor=\"#3366CC\" colspan=\"2\">\n";
		echo "<table width=\"100%\" cellspacing=0 cellpadding=1 border=0>\n";
		echo "<tr>\n";
		echo "<td align=\"LEFT\" bgcolor=\"#3366CC\"><b><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\"><a class=\"psf\" href=\"index.php?action=qa&faq=$faq_id\" style=\"color: #FFFFFF\">$the_faq</a></font></b></td>\n";
		echo "<td align=\"RIGHT\" bgcolor=\"#3366CC\" width=\"120\" nowrap><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\"><a class=\"psf\" href=\"index.php?action=qa&faq=$faq_id\" style=\"color: #FFFFFF\"><b>$view_faq_lang</b></a></font></td>\n";
		echo "</tr>\n";
		echo "</table>";
		echo "</td>\n";
		echo "</tr>\n";
		$get = "SELECT * 
				FROM $database_name.$category_table 
				WHERE faq_id='$faq_id'
				ORDER BY category";
		$result = mysql_query($get, $connection);
		$num_result = mysql_numrows($result);
		if ($num_result != 0) 
		
			{
				while ($myrow = mysql_fetch_array($result)) 
				
					{
						$category = $myrow["category"];
						$cat_id = $myrow["cat_id"];
						$q_get = "SELECT question_id 
								  FROM $database_name.$question_table 
								  WHERE cat_id='$cat_id'";
						$q = mysql_query($q_get, $connection);
						$q_total = mysql_numrows($q);
						if ($q_total == 1) 
						
							{
								$q_num = "$q_total $question_lang";
							} else {
								$q_num = "$q_total $questions_lang";
							}							
							
						echo "<tr>\n";
						echo "<td align=\"LEFT\" valign=\"TOP\" bgcolor=\"#DDDDDD\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\"><a class=\"psf\" href=\"index.php?action=qa&category=$cat_id\">$category</a></font></td>\n";
						echo "<td align=\"LEFT\" valign=\"TOP\" bgcolor=\"#DDDDDD\" width=\"110\" nowrap><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\"><a class=\"psf\" href=\"index.php?action=qa&category=$cat_id\">$q_num</a></font></td>\n";
						echo "</tr>\n";
					
					}
			} else {
				echo "<tr>\n";
				echo "<td align=\"LEFT\" valign=\"TOP\" bgcolor=\"#DDDDDD\" colspan=\"2\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\"><a class=\"psf\" href=\"admin.php\">$add_category2_lang</a></font></td>\n";
				echo "</tr>\n";
			}
	}	
		
?>

</table>
Return current item: PHP Simple FAQ