Help with [PHP] & [mySQL]
#1

How do i withdrawl an amount, or value, From somones mysql account? Not resetting it, But checking if they have the amount first (I can do that), Then taking the amount required.

PHP код:

if($row[4] >= 60)
{
         echo 
'Ok you have enough...';
         
//Do mysql stuff here...
         
die;
}
if(
$row[4] <= 59)
{
         echo 
'You dont have enough!';
         
//Then the back button or redirect.
         
die;

But how would i go about Just taking the amount out, Like in pawn GivePlayerMoney(playerid, -500);

?!!?
Reply
#2

Noone knowz?!
Reply
#3

Код:
 $row -= or $row +=
edit :

pawn Код:
$row -= 500
Reply
#4

Well a simple UPDATE query for subtraction is all you need since you know how to do the check.

pawn Код:
mysql_query('UPDATE `table` SET Money = Money - 500 WHERE ID = 50');
Reply
#5

Thanks! will let yyou know if works..

EDIT: Ran into other problems... hold on plz.
Reply
#6

Works! Thank you!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)