MySQL Problem
#1

I got this issue, that it doesn't work.

It should give the user the 100 dollars, but it doesn't... And yeah, it's when he is offline...

Can anybody tell me why it doesn't work?

pawn Код:
mysql_format(sqlHandle, buffer, sizeof(buffer), "SELECT FROM `samp_users` GET `bank` WHERE `user` = 'Orson_Lynch'");
                           
                            new int_dest = cache_get_row_int(0, 0);
                           
                            int_dest += 100;
                           
                            mysql_format(sqlHandle, buffer, sizeof(buffer), "UPDATE samp_users SET bank = %i WHERE user = 'Orson_Lynch'", int_dest);
                           

                            mysql_format(sqlHandle, buffer, sizeof(buffer), "INSERT INTO `samp_adverts` (`advert`, `owner`) VALUES ('%e', '%e')", inputtext, PlayerInfo[playerid][pName]);
                            mysql_function_query(sqlHandle, buffer, false, "", "");
Reply
#2

It doesn't really work out, but it works fine when he's ingame, but that's with a different code.
Reply
#3

Select query is completely wrong since there's no such thing as "GET". That said, you can easily increment a column in the database itself, without having to read it in Pawn first.
PHP код:
UPDATE samp_users SET bank bank 100 WHERE user 'Orson_Lynch' 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)