Note that there are some explanatory texts on larger screens.

plurals
  1. POMySQL DB Column Not Updating after TinyMCE post INSERT
    primarykey
    data
    text
    <p>I've managed to implement a simple TinyMCE editor on my site and have it call using mySQL database. My problem Im having now is getting the DB to overwrite the contents already stored inside with what is being posted?</p> <p>I simply want to overwrite the table contents (within the column) with what is being inserted. </p> <pre><code> Here is my code: &lt;!--- CONNECT TO THE DATABASE------&gt; &lt;?php $con = mysql_connect("localhost","root","jdkldk8%by"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("cms", $con); $sql="INSERT INTO tinymce (contents, contact, slider, resources) VALUES ('$_POST[contents]','$_POST[contact]','$_POST[slider]','$_POST[resources]')"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "1 record added"; mysql_close($con); ?&gt; &lt;!--- END DATABASE SETTINGS -----&gt; </code></pre> <p>[ View your changes here ]</p> <p>///////////////////////////////////////////////////////////////////////////////////////</p> <p>Well... i tried again but its still not posting all fields to the DB! only updating 1.</p> <pre><code> &lt;!--- CONNECT TO THE DATABASE------&gt; &lt;?php require_once('db.php'); $contents=$_POST['contents']; $contact=$_POST['contact']; $slider=$_POST['slider']; $resources=$_POST['resources']; $id='1'; $sql="UPDATE tinymce SET `contents`='$contents', `contact`='$contact', `slider`='$slider', `resources`='$resources' WHERE id='$id'"; if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); } echo "Saved!"; mysql_close($con); ?&gt; &lt;!--- END DATABASE SETTINGS -----&gt; </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.
 

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