Location: PHPKode > projects > PHP Simple FAQ > phpsimplefaq1.1beta/phpsimplefaq/includes/faq_fullpage.inc.php
<? 	// PHP Simple FAQ Index page v1.0

$get_faq = "SELECT faq_title 
			FROM $database_name.$faq_table 
			WHERE faq_id='$faq'";
$result_faq = mysql_query($get_faq, $connection);
$myrow11 = mysql_fetch_array($result_faq);
$faq_title = $myrow11["faq_title"];

?>
<table border="0" width="100%" cellspacing="2" cellpadding="2">
	<tr valign=top align=left>
		<td colspan=3><? echo "<font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\">" ?>
		<center><b><? echo "<a class=\"psf\" href=\"index.php\">$main_title</a> > $faq_title"; ?></b></center></font></td>
	</tr>
</table>
<br>
<center>
<table width="90%" cellpadding="4" cellspacing="2" bgcolor="#333366">
	
<?

$get = "SELECT * 
		FROM $database_name.$category_table 
		WHERE faq_id='$faq'
		ORDER BY category";
$result = mysql_query($get, $connection);
if (mysql_numrows($result) == 0) 
		
			{
				echo "<tr>\n";
			    echo "<td align=\"LEFT\" bgcolor=\"#CCCCCC\"><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";
			}
			
while ($myrow = mysql_fetch_array($result)) 

	{
		$cat = $myrow["category"];
		$cat_id = $myrow["cat_id"];
		echo "<tr>\n";
		echo "<td bgcolor=\"#3366CC\">\n";
		echo "<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">";
		echo "<tr>";
		echo "<td align=\"LEFT\" bgcolor=\"#3366CC\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\" color=\"#ffffff\"><a class=\"psf\" href=\"index.php?action=qa&category=$cat_id\" style=\"color: #FFFFFF\"><b>$cat</a></b></font></td>\n";
		echo "<td align=\"RIGHT\" bgcolor=\"#3366CC\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\" color=\"#ffffff\"><a class=\"psf\" href=\"index.php?action=qa&category=$cat_id&add_question=true#question\" style=\"color: #FFFFFF\"><b>$add_question2_lang</b></a></font></td>\n";
		echo "</tr>\n";
		echo "</table>\n";
		echo "</td>\n";
		echo "</tr>\n";
		$q_get = "SELECT *
				  FROM $database_name.$question_table 
				  WHERE cat_id='$cat_id'";
		$q = mysql_query($q_get, $connection);
		$q_num = mysql_numrows($q);
		if ($q_num == 0) 
		
			{
				echo "<tr>\n";
			    echo "<td align=\"LEFT\" bgcolor=\"#CCCCCC\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\">$no_questions_lang</font></td>\n";
			    echo "</tr>\n";
			}
		
		while ($myrow4 = mysql_fetch_array($q)) 
		   
		   {
			   $question = $myrow4["question"];
			   $question_id = $myrow4["question_id"];
			   $cat_id = $myrow4["cat_id"];
			   echo "<tr>\n";
			   echo "<td align=\"LEFT\" bgcolor=\"#CCCCCC\">\n";
		   	   echo "<table width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" border=\"0\">";
			   echo "<tr>";
			   echo "<td align=\"LEFT\" bgcolor=\"#CCCCCC\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\"><I>$question</I></font></td>\n";
			   echo "<td align=\"RIGHT\" bgcolor=\"#CCCCCC\" width=\"100\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\" color=\"#ffffff\"><a class=\"psf\" href=\"index.php?action=answers&category=$cat_id&q_id=$question_id\">$answer_this_lang</a></font></td>\n";
			   echo "</tr>\n";
			   echo "</table>\n";
			   echo "</td>\n";			   
			   echo "</tr>\n";
			   $a_get = "SELECT *
						 FROM $database_name.$answer_table 
						 WHERE q_id='$question_id'";
			   $a = mysql_query($a_get, $connection);
			   while ($myrow5 = mysql_fetch_array($a)) 
			   
					{
						 $answer = $myrow5["answer"];
						 $answer_id = $myrow5["answer_id"];
						 echo "<tr>\n";
						 echo "<td align=\"LEFT\" bgcolor=\"#EEEEEE\"><font face=\"$font_face\" size=\"$font_size\" class=\"$font_class\">$answer</font></td>\n";
						 echo "</tr>\n";
					}
			}
	}
	
?>
</table>
</center>
Return current item: PHP Simple FAQ