i am building a simple FAQs database, 2 tables, categories and questions/answers, i have cats on the left and q and a's on the right, but am getting SQL syntax error on second statement
TIA
dom
<?
include('connect.php');
error_reporting(E_ALL ^ E_NOTICE);
$category = mysql_query("SELECT * FROM faqcategories ORDER BY faqcategoryTypeName");
if (!$category) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit();}
IF ( $faqcategoryTypeName == "" ) {
$faqcategoryTypeName == "general"
;}
ELSE {
}
$faqs = mysql_query("SELECT * FROM faqanswers, faqcategories WHERE faqanswers.faqcategoryID = faqcategories.faqcategoryID AND faqcategories.faqcategoryTypeName=$faqcategoryTypeName");
if (!$faqs) { echo("<P>Error performing query: " . mysql_error() . "</P>"); exit();}
?>
<table width=100%>
<tr>
<td>
<?
while ( $row = mysql_fetch_array($category) ) {
$type = $row["faqcategoryTypeName"];
echo "<a href=faq.php?faqcategoryTypeName=$type> $type</a><br>";
}
?>
</td>
<?
$row = mysql_fetch_array($faqs);
$question = $row["faqquestion"];
$answer = $row["faqanswer"];
echo "<td>$question : $answer</td>";
?>