Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 5 Months, 3 Weeks ago Update Query problem
#1
Solved: 3 Years, 5 Months, 3 Weeks ago
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
Reply
#2
Solved: 3 Years, 5 Months, 3 Weeks ago
$db->update_query('posts', array('sid' => 'sid+1'), 'pid=\'200\'');

But why?
Reply
#3
Solved: 3 Years, 5 Months, 3 Weeks ago
(2016-10-15, 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.
Reply
#4
Solved: 3 Years, 5 Months, 3 Weeks ago
Should I assume a typo? Your query has WHER instead of WHERE.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)