PDA

View Full Version : Help with a query string...


N9ne
02-14-2003, 10:46 PM
$DB_site->query("UPDATE user SET ".iif ($foruminfo[countposts],"posts=posts + $p2,","")." $dotitle","lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");


The part where it says posts=posts + $p2

It's not working, i'm not sure how to put it so it does work...$p2 is defined as a digit, say 2. So how would I make it so it ends up doing posts+2 ? Hardcoding isn't an option as it's dynamic from the adminCP.

So how do I make it so it will work properly?

Xenon
02-15-2003, 11:13 AM
try this one:
$DB_site->query("UPDATE user SET ".iif ($foruminfo[countposts],"posts=posts + ". intval($p2) . ",",""). $dotitle."lastpost='".time()."' WHERE userid='$bbuserinfo[userid]'");