Try this:
// Fetch some info from the faq
$result = $db->query('SELECT id,faq_name, question, answer, disp_position FROM '.$db->prefix.'faq ORDER BY disp_position') or error('Unable to fetch faq info', __FILE__, __LINE__, $db->error());
if (!$db->num_rows($result))
message($lang_common['Bad request'], true);
if ($db->num_rows($result))
{
while (list($id, $faq_name, $question, $answer, $disp_position) = $db->fetch_row($result);
)
{
list($faq_name, $question, $answer, $disp_position) = $db->fetch_row($result);
?>
<tr>
<td class="puncon1" style="width: 240px; vertical-align: top" ><p style="margin-bottom: 0"><b><?php echo $lang_faq['question'].$disp_position.'</p><p style="margin-left: 10px; margin-top: 5px; margin-bottom: 5px"></b>'.$question ?></p></td>
<td class="puncon2" style="vertical-align: top"><p style="margin-bottom: 0"><b><?php echo $lang_faq['answer'].'</b></p><p style="margin-left: 10px; margin-top: 5px; margin-bottom: 5px">'.$answer ?></p></td>
</tr>
Please note two things:
1) I assumed there's an id field on the table. Might not be so.
2) Since you're not using the $id variable you could take it off, but if you want to make links to these faqs or something, you might need it. Can't say.
I just erased the $id=... from the while and substituted it from the real one. You should as well erase the first one, or you'll always miss the first record. I think the recordcount should work exactly the same, but if it doesn't (if you get an empty recordset) you'll have to change the while bucle to a do while or erase the recordcount if and use a trafficlight variable inside the bucle, so as to know if the recordset was really empty or not (that might be the most speed effective solution, although not the most elegant) that way, I'd do something like:
$light=true;
while {... $light=false;}
if ($light) then echo('empty');
Hope that solves your problem.