Note that there are some explanatory texts on larger screens.

plurals
  1. POmysql_num_rows() expects parameter 1 to be resource, boolean given
    text
    copied!<p>I know that THERE ARE MANY questions about this and I have been looking for hours for my solution and I just can't seem to find what is wrong with my code, besides seeing that mysql_query should be changed to mysqli_query but when I change it it gives me even more error messages and I don't know what else to try now. Please help if you can, this is starting to take a lot of my time. THANKS! (Don't criticize by saying "there's so many of the same questions" I think every person ends up posting theirs because they couldn't find an answer to their problem because it doesn't match the others, at least in my case I looked before asking with no success.)</p> <pre><code> // try get "MySQL link identifier" $dbConn = mysql_connect($serverName, $user_name, $password) or die("Cannot connect to server&lt;br /&gt;\n MySQL error ==&gt;" . mysql_errno() . "&lt;== : ==&gt;" . mysql_error() . "&lt;== &lt;br /&gt;\n"); print ""; // try connect to database mysql_select_db($db_name, $dbConn) or die("Cannot connect to database&lt;br /&gt;\n MySQL error ==&gt;" . mysql_errno($dbConn) . "&lt;== : ==&gt;" . mysql_error($dbConn) . "&lt;== &lt;br /&gt;\n"); print "&lt;br /&gt;\n"; // Retrieve data from database $id = $_GET['id']; $additional_notes = $_GET['additional_notes']; // update data in mysql database $sql=("UPDATE `rmstable2` SET `additional_notes` = '$additional_notes' WHERE `id` = '$id'"); $result = mysql_query($sql) or die(mysql_error()); $resultcount = mysql_affected_rows($result); if ($resultcount == 1) { mysql_query("UPDATE `rmstable2` SET `additional_notes` = '$additional_notes' WHERE `id` = '$id'") or die(mysql_error()); } // if successfully updated. if($result) { echo "Update Successful!"; echo '&lt;h3&gt;Your case has been updated.&lt;/h3&gt;'; echo "To see your changes please click &lt;a href='/fullcase.php?id=$id'&gt;here&lt;/a&gt;&lt;/b&gt;"; } else { echo "ERROR"; } ?&gt; </code></pre>
 

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