Hey, I have a field called STATUS and this is 1 or 0 to show or hide. My code is below I am using an editing in place editor with jQuery. Every time you update it, I create a new ROA that I want, but I only want a new one that is STATUS = 1 and the other 0. How do I do this with any idea?
& lt; Php includes "../../inc/config.inc.php"; $ Temp = Explosion ("_", $ _REQUEST ['element_id']); $ Field = $ temp [0]; $ Id = $ temp [1]; $ Textboxwall = straps (mysql_real_escape_string (preg_replace ('/ [\ $] /', "", $ _ request ["update_value"]))); $ Query = "INSERT Notes ($ field, position, date, c_id) VALUES ('$ textboxval', '1', NOW (), '$ id')"; Mysql_query ($ query); Echo ($ _ request ['update_value']); ? & Gt;
I'm not sure what you say - do you want to create all the entries In addition to the new situation is = 0? If so, issue an update before submitting:
UPDATE notes SET status = 0
However, I should also note that By applying "Mysql real escape string" to worry about a possible SQL injection, by slipping after , you could potentially allow anyone to keep the text in your SQL statement Which will execute an arbitrary SQL statement.
Comments
Post a Comment