Jump to content

can someone please help with this SQL query,


mackevin

Recommended Posts

<?php

$tbl_name2="forum_answer"; // Switch to table "forum_answer"

 

$sql2="SELECT * FROM $tbl_name2 WHERE question_id='$id'";

$result2=mysql_query($sql2);

 

while($rows=mysql_fetch_array($result2)){

?>

 

is the code used this seems to be the reply

 

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/flyboyst/public_html/view_topic.php on line 81

 

what am I doing wrong here, it is for a simple php forum.

 

PLEASE HELP

 

thanks in advance ???

Your code is incomplete. 

 

while($rows=mysql_fetch_array($result2)){
?>

 

That doesn't make any sense because you open the while statement then end the PHP.

 

Should be something like:

 

while($rows=mysql_fetch_array($result2)){  echo $rows['question_id']; }
?>

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.