Welcome to HBH! If you have tried to register and didn't get a verification email, please using the following link to resend the verification email.

PHP ... Last Question


ghost's Avatar
0 0

why doesn't this code work… it only does whats in the else… i have a js1 row setup in my site_users and its a smallint in the database… it only does the else stuff.. even if the row is = to 5… so someone tell me why this isn't working please!!

<? $result = dbquery("select * from site_users where user_id=".$userdata['user_id']); if ($result['js1'] == '5') { echo "ERROR: You've Already Done This!"; } else { $rr = dbquery('update '.$db_prefix.'users set js1=5 where user_id='.$userdata['user_id'].' limit 1;'); $rrr = dbquery('update '.$db_prefix.'users set user_points=user_points+3 where user_id='.$userdata['user_id'].' limit 1;'); } ?>


ghost's Avatar
0 0

in the first part your missing a ' after the = and then again after the var… :)


ghost's Avatar
0 0

you should only select what you need and you can do the 2 update queries in 1 query ;)


ghost's Avatar
0 0

also make sure youre connected to the right database lol :)