Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Alexandra,</p> <p>All though this will not solve all of your errors. It has useful comments and will help you zero in on the exact issue. Can you execute this and let me know what you actually see?</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']; // Assuming id is always numeric you could sanitize and validate it like below $id = intval($_GET['id']); if( $id&lt;=0 ){ // Let user know or redirect to a page when id is not present // Or even better do not run the queries at all } // update data in mysql database //$sql=("UPDATE `rmstable2` SET `additional_notes` = '$additional_notes' WHERE `id` = '$id'"); // Escape strings; you could try something like this $sql=("UPDATE `rmstable2` SET `additional_notes` = '" . mysql_escape_string($additional_notes) . "' WHERE `id` = '$id'"); </code></pre> <p>// for debugging only (better practice is to use error_log) echo '<pre>SQL: ' . $sql . '</pre>';</p> <pre><code>$result = mysql_query($sql); if($result){ //$resultcount = mysql_num_rows($result); // Instead $resultcount = mysql_affected_rows($result); if ($resultcount == 1) { mysql_query("UPDATE `rmstable2` SET `additional_notes` = '$additional_notes' WHERE `id` = '$id'") or die(mysql_error()); }else{ // Nothing was updated // maybe rows didn't match? echo "No data was updated."; } }else{ // mysql_query returned FALSE // There must be an error echo "DB Error: " . 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"; } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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