Note that there are some explanatory texts on larger screens.

plurals
  1. POupdate column where id =?
    text
    copied!<p>Im trying to update a column ('content') in my table ('ptb_messages') where the 'id' of the message is the same as the one being echoed in my form upon submit so WHERE id='".$message_id." which is a global function ive set. the id of the message is being echoed fine the problem is in the function or mysql script.</p> <p>can someone perhaps show me where im going wrong with this. thanks</p> <p>html form:</p> <pre><code> &lt;form id="reply" action="message_reply.php?to=&lt;?php echo "".$message_id.""; ?&gt;" method="post"&gt; &lt;textarea name="textarea" id="textarea"&gt;&lt;?php echo "{$message['content']}"; ?&gt;&lt;/textarea&gt; &lt;?php } ?&gt; &lt;input type="image" src="assets/img/icons/email_send.png" width="50" height="34" name="send_button" id="send_button"&gt; &lt;/form&gt; mysql function: &lt;?php require_once("includes/session.php"); require_once("includes/functions.php"); require('includes/_config/connection.php'); ?&gt; &lt;?php session_start(); include 'includes/_config/connection.php'; $textarea = $_POST['textarea']; $result = mysql_query("SELECT content FROM ptb_messages WHERE id='".$message_id."'"); if(!$result) { echo "The username you entered does not exist"; } else if($textarea!= mysql_result($result, 0)) { echo ""; $sql=mysql_query("UPDATE ptb_messages SET content ='".addslashes($textarea)."' WHERE id='".$message_id."'"); } if($sql) { } header("Location: {$_SERVER['HTTP_REFERER']}"); ?&gt; </code></pre> <p>i receive these errors:</p> <pre><code>Warning: mysql_result() [function.mysql-result]: Unable to jump to row 0 on MySQL result index 9 in /Applications/XAMPP/xamppfiles/htdocs/ptb1/message_reply.php on line 25 Warning: Cannot modify header information - headers already sent by (output started at /Applications/XAMPP/xamppfiles/htdocs/ptb1/message_reply.php:25) in /Applications/XAMPP/xamppfiles/htdocs/ptb1/message_reply.php on line 37 </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