Jump to content

unknown column in where clause problem!


rille95

Recommended Posts

Hi!

 

I've the gpt script from getpaidscene.com and i am trying to code a percentage referral sytstem.

I've coded it so when i approve an offer that user have maid this code runs :

 

mysql_query("update users set total_earned=total_earned+$refreward,current_balance=current_balance+$refreward where username=$referrer",$c) or die (mysql_error());

 

of course that's not all the code but that is where the problem is.

 

i get this error message : Unknown column 'blazer' in 'where clause'

but i am 100% sure that blazer is a user.

Link to comment
https://forums.phpfreaks.com/topic/172378-unknown-column-in-where-clause-problem/
Share on other sites

Because you're not wrapping your string $referrer in quotes, MySQL is treating it as a column.

 

mysql_query("UPDATE users SET total_earned = total_earned + $refreward, current_balance = current_balance + $refreward WHERE username='$referrer'", $c) or die (mysql_error());

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.