[eluser]teddy[/eluser]
I have simple store update
Code:
DELIMITER $$
CREATE PROCEDURE update_post($post_id int(11),$title varchar(100))
BEGIN
set @query=concat('update tbl_posts set title=', $title);
set @where=concat(' where id=',$post_id);
set @query=concat(@query,@where);
prepare stmt from @query;
execute stmt ;
deallocate prepare stmt;
END
and I call it $this->db->query("call update_post('$post_id','$title')") but it working when $title is only have a word and without any blank space, someone help me pls, if have any blank space I will get it error:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '222 1111 where id=204' at line 1
Thank for reading my topic