Jump to content

[SOLVED] Decreasing a value using Select Query


ballouta

Recommended Posts

I tried these but not working

 

$query = " UPDATE `gsclteam_gsteam`.`credits` SET `creditsnum` = creditsnum-1 WHERE `uploaded`.`user` = '$user' ";

$query = " UPDATE `gsclteam_gsteam`.`credits` SET `creditsnum` = 'creditsnum-1' WHERE `uploaded`.`user` = '$user' ";

 

Why?

sorry, yes there's a mistake in the query, actually i need to use only one table

 

the code is fixed now:

 

$query = " UPDATE `credits` SET `creditsnum` = creditsnum-1 WHERE `user` = '$user' ";

$result = mysql_query($query);

 

still not working, is there another way to make creditsum = creditsnum -1 ?

 

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.