php - "UPDATE cms_content WHERE title='homepage" SET value = ?" -
Again Lisa ... As stated earlier, I am making a system, and I have a content from a database I want to load, in my AdminCP, I want users to edit the content, so that I am doing this in changecontent.php:
if (isset ($ _ POST ['change_content'])) {$ Name = $ _POST ['Content']; $ Errorscontent = $ users- & gt; ChangeContent ($ text); }
and other file:
public function change resource ($ text) {$ errorscontent = array (); $ Stmt = $ this- & gt; Mysqli- & gt; Ready ("UPDATE cms_content WHERE title = 'homepage' SET text =?"); $ Stmt-> gt; Bind_param ('s', $ text); $ Stmt- & gt; Executed (); $ Stmt- & gt; near (); $ Errorsslide [] = "& quot; div class = 'alert alert-success' & gt; button type =' button 'square =' closed 'data-reject =' alert '' x & lt; / Button & gt; & lt; strong & gt; success! & Lt; / strong & gt; Homepage content has changed successfully! & Lt; / div & gt; "; Return $ errorscontent; }
Does anyone know what I am doing?
Lisa
SET
in your query WHERE should come before
:
$ stmt = $ this- & gt; Mysqli- & gt; Ready ("UPDATE cms_content WHERE title = 'homepage' SET text =?");
should be:
$ stmt = $ this- & gt; Mysqli- & gt; Ready ("UPDATE cms_content SET text =? WHERE title = 'homepage' ');
Comments
Post a Comment