PDA

View Full Version : MySQL update+in (what does it mean?!)


Radgam
05-23-2003, 12:10 PM
Example for updating thread information in vb:

$DB_site->query("UPDATE forum SET replycount=replycount+1,lastpost='".time()."',
lastposter='".addslashes($postusername)."' WHERE forumid IN ($foruminfo[parentlist])")

what does the "IN" mean?

I'm guessing judging by the database it allows you to use a list of numbers so if $foruminfo[parentlist] is 2,1,-1 it will update each one of them? :confused:

Thanks, curious for some code mods i'm doing on my forum :)

Xenon
05-23-2003, 01:46 PM
exactly

if forumid is in 2,1,-1 it will update this forum :)

Radgam
05-23-2003, 02:28 PM
Thanks :) Just wanted to check incase i do something majorly bad like screwing up the database ;)

Mysql and php aren't exactly my strong points after doing only perl for years but i'm trying to move into new things :)