Note that there are some explanatory texts on larger screens.

plurals
  1. POUnknown column 'titletext' in 'field list'
    text
    copied!<p>I'm having the error listed above when I try to update my database through php. The error seems to be coming from the titletext which is a column in my database. The images seem to update ok but I'm having problem with the text.Any help would be appreciated.</p> <pre><code>&lt;?php include('../connect.php'); $updateid= $_POST['updaterow']; $updatetitletext= mysql_real_escape_string(htmlentities($_POST['newtitletext'])); $updatemaintext= mysql_real_escape_string(htmlentities($_POST['newmaintext'])); $updateslidetitle1= mysql_real_escape_string(htmlentities($_POST['newslidetitle1'])); $updateslidetitle2= mysql_real_escape_string(htmlentities($_POST['newslidetitle2'])); $updateslidetitle3= mysql_real_escape_string(htmlentities($_POST['newslidetitle3'])); $updateslidetext1= mysql_real_escape_string(htmlentities($_POST['newslidetext1'])); $updateslidetext2= mysql_real_escape_string(htmlentities($_POST['newslidetext2'])); $updateslidetext3= mysql_real_escape_string(htmlentities($_POST['newslidetext3'])); $updateslide1 = $_FILES['updateslide1']['name']; $updateslide1temp = $_FILES['updateslide1']['tmp_name']; $updateslide1type = $_FILES['updateslide1']['type']; $updateslide1size = $_FILES['updateslide1']['size']; $updateslide2 = $_FILES['updateslide2']['name']; $updateslide2temp = $_FILES['updateslide2']['tmp_name']; $updateslide2type = $_FILES['updateslide2']['type']; $updateslide2size = $_FILES['updateslide2']['size']; $updateslide3 = $_FILES['updateslide3']['name']; $updateslide3temp = $_FILES['updateslide3']['tmp_name']; $updateslide3type = $_FILES['updateslide3']['type']; $updateslide3size = $_FILES['updateslide3']['size']; if (!empty($updateslide1)) { if ($updateslide1type == 'image/gif' || $updateslide1type == 'image/jpg' || $updateslide1type == 'image/jpeg' &amp;&amp; $updateslide1size &gt; 0 &amp;&amp; $updateslide1size &lt; 2000000){ move_uploaded_file($updateslide1temp,"../img/$updateslide1"); $query = "UPDATE adminindex SET maintext='$updatemaintext', titletext='$updatetitletext', slidetitle1='$updateslidetitle1', slidetitle2='$updateslidetitle2', slidetitle3='$updateslidetitle3', slidetext1='$updateslidetext1', slidetext2='$updateslidetext2', slidetext3='$updateslidetext3', slide1='$updateslide1' WHERE id = '$updateid'"; } else{ echo "&lt;p&gt;file needs to be a jpg/gif or file size too big.&lt;/p&gt;"; die(); } }else{ $query = "UPDATE adminstore SET maintext='$updatemaintext', titletext='$updatetitletext', slidetitle1='$updateslidetitle1', slidetitle2='$updateslidetitle2', slidetitle3='$updateslidetitle3', slidetext1='$updateslidetext1', slidetext2='$updateslidetext2', slidetext3='$updateslidetext3' WHERE id = '$updateid'"; } mysql_query($query) or die(mysql_error()); if (!empty($updateslide2)) { if ($updateslide2type == 'image/gif' || $updateslide2type == 'image/jpg' || $updateslide2type == 'image/jpeg' &amp;&amp; $updateslide2size &gt; 0 &amp;&amp; $updateslide2size &lt; 2000000){ move_uploaded_file($updateslide2temp,"../img/$updateslide2"); $query = "UPDATE adminindex SET maintext='$updatemaintext', titletext='$updatetitletext', slidetitle1='$updateslidetitle1', slidetitle2='$updateslidetitle2', slidetitle3='$updateslidetitle3', slidetext1='$updateslidetext1', slidetext2='$updateslidetext2', slidetext3='$updateslidetext3', slide2='$updateslide2' WHERE id = '$updateid'"; } else{ echo "&lt;p&gt;file needs to be a jpg/gif or file size too big.&lt;/p&gt;"; die(); } }else{ $query = "UPDATE adminindex SET maintext='$updatemaintext', titletext='$updatetitletext', slidetitle1='$updateslidetitle1', slidetitle2='$updateslidetitle2', slidetitle3='$updateslidetitle3', slidetext1='$updateslidetext1', slidetext2='$updateslidetext2', slidetext3='$updateslidetext3' WHERE id = '$updateid'"; } mysql_query($query) or die(mysql_error()); if (!empty($updateslide3)) { if ($updateslide3type == 'image/gif' || $updateslide3type == 'image/jpg' || $updateslide3type == 'image/jpeg' &amp;&amp; $updateslide3size &gt; 0 &amp;&amp; $updateslide3size &lt; 2000000){ move_uploaded_file($updateslide3temp,"../img/$updateslide3"); $query = "UPDATE adminindex SET maintext='$updatemaintext', titletext='$updatetitletext', slidetitle1='$updateslidetitle1', slidetitle2='$updateslidetitle2', slidetitle3='$updateslidetitle3', slidetext1='$updateslidetext1', slidetext2='$updateslidetext2', slidetext3='$updateslidetext3', slide3='$updateslide3' WHERE id = '$updateid'"; } else{ echo "&lt;p&gt;file needs to be a jpg/gif or file size too big.&lt;/p&gt;"; die(); } }else{ $query = "UPDATE adminindex SET maintext='$updatemaintext', titletext='$updatetitletext', slidetitle1='$updateslidetitle1', slidetitle2='$updateslidetitle2', slidetitle3='$updateslidetitle3', slidetext1='$updateslidetext1', slidetext2='$updateslidetext2', slidetext3='$updateslidetext3' WHERE id = '$updateid'"; } mysql_query($query) or die(mysql_error()); mysql_close(); ?&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