MyBB Community Forums

Full Version: Update Query problem
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,

when posting, I want to change value 'sid' into 'sid+1' whrere pid>200,

so, I added this code in 'inc/datahandlers/post.php'

$sql = "UPDATE posts SET sid=sid+1 WHER pid>200";

$db->query($sql);

but it dosen't work..

error : VM8094:1 Uncaught SyntaxError: Unexpected token

What should I do?  Huh
$db->update_query('posts', array('sid' => 'sid+1'), 'pid=\'200\'');

But why?
(10-15-2016, 10:03 AM)Sazze Wrote: [ -> ]
$db->update_query('posts', array('sid' => 'sid+1'), 'pid=\'200\'');

But why?


thx!!

I want to put reply-post under target post.

like,
POST A
 -Reply Post B to A:
   -Reply Post C to B:
  -Reply Post D to A:
POST B
POST C

To make this, Display Order(sid and something) should increase when posting replies.
Should I assume a typo? Your query has WHER instead of WHERE.