Note that there are some explanatory texts on larger screens.

plurals
  1. POPHP: mysql_fetch_array() expects parameter 1 to be resource, boolean given
    text
    copied!<blockquote> <p><strong>Possible Duplicate:</strong><br> <a href="https://stackoverflow.com/questions/2938631/mysql-php-parameter-1-as-resource">MySQL &amp; PHP Parameter 1 as Resource</a> </p> </blockquote> <p>I am getting shown in the title on my website and don't what kind of error this is, neither do I know how to fix this. Can anyone help me?</p> <p>This is the add_answer.php file: </p> <pre><code>&lt;?php include("mysql_forum_test.php"); // Get value of id that sent from hidden field $id=$_POST['id']; // Find highest answer number. $sql="SELECT MAX(a_id) AS Maxa_id FROM $tbl_name WHERE question_id='$id'"; $result=mysql_query($sql); $rows=mysql_fetch_array($result); // add + 1 to highest answer number and keep it in variable name "$Max_id". if there no answer yet set it = 1 if ($rows) { $Max_id = $rows['Maxa_id']+1; } else { $Max_id = 1; } // get values that sent from form $a_name=$_POST['a_name']; $a_email=$_POST['a_email']; $a_answer=$_POST['a_answer']; $datetime=date("d/m/y H:i:s"); // create date and time // Insert answer $sql2="INSERT INTO $tbl_name(question_id, a_id, a_name, a_email, a_answer, a_datetime)VALUES('$id', '$Max_id', '$a_name', '$a_email', '$a_answer', '$datetime')"; $result2=mysql_query($sql2); if($result2){ echo "Successful&lt;BR&gt;"; echo "&lt;a href='index.php?content=view_topic?id=".$id."'&gt;View your answer&lt;/a&gt;"; // If added new answer, add value +1 in reply column $tbl_name2="forum_question"; $sql3="UPDATE $tbl_name2 SET reply='$Max_id' WHERE id='$id'"; $result3=mysql_query($sql3); } else { echo "ERROR"; } mysql_close(); ?&gt; </code></pre> <p>Thanks</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload