• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help with database query.

#2
You can do something like that (with mysql).

PHP Code:
delete from comments where id 10
select id from comments where discussions_id 
= [discussion_idorder by id DESC limit 1
update discussions set last_comment_id 
= [the return value of the select above

Reply


Messages In This Thread
Help with database query. - by T3utonicT3rror - 04-23-2015, 04:38 AM
RE: Help with database query. - by Rufnex - 04-23-2015, 05:03 AM
RE: Help with database query. - by T3utonicT3rror - 04-23-2015, 05:16 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.