php - What is wrong with this mysql statement - INSERT INTO ... WHERE ... OR? -


this mysql statement reason isn't working , can't figure out why. in advance!

$id = $_get['post']; $length = $_post['excerpt_length'];  more code here connect , select db...  mysql_query(" insert wp_posts (excerpt) values(" . $length . ") id = " . $id . " or post_name '" . $id . "%'"); 

this wordpress , i'm making option add excerpt length because far aware, there isn't yet. thanks!

ethan brouwer

you cant use in insert because supposed create new record, there no referenced for. must use update instead.

mysql_query(" update wp_posts  set excerpt = '" . $length . "' id = '" . $id . "' or post_name '" . $id . "%'"); 

Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -