MYSQL debug says saved, but nothing is saved
#1

Hi everyone,

I have a strange problem with my MYSQL saving system....
The MYSQL debug says, that everything is succesfully executed and that there were no errors.
But when i look into the database, nothing has changed.

Here is the MYSQL debug:
Code:
[13:21:14] >> mysql_query( Connection handle: 1 )

[13:21:14] CMySQLHandler::Query(UPDATE Users SET Money = '5999', Level = '1', Admin = '6', Helper = '1', VipLevel = '0', Skin = '240', Kills = '0', Deaths = '0', Muted = '0', Cell = '0', Cigs = '0', Watch = '0', Mask = '0', GasCan = '0', Sprunk = '0', Stereo = '0', GoldCoins = '0', PaymentMethod = '0', DriversLic = '0', WeaponLic = '0', HeavyVLic = '0', PilotLic = '0', BlockedPM = '0',Proposing = '0',Warnings = '0',Exp = '0'WHERE Username = '') - Successfully executed.

[13:21:14] >> mysql_query( Connection handle: 1 )

[13:21:14] CMySQLHandler::Query(UPDATE Users SET Phonebook = '0'WHERE Username = 'Jari_Johnson') - Successfully executed.
As you can see the debug says that 5999 money is written in the dabatabse, but in fact, there is still 5000...

Anyone experienced the same problem?
Reply
#2

Isn't it obvious?
Code:
WHERE Username = ''
Reply
#3

Click 'Refresh' on phpmyadmin, navicat, heidisql or whatever database program you're using.

Edit:
I fail, didn't see what VincentDunn saw xD
Reply
#4

Quote:
Originally Posted by VincentDunn
View Post
Isn't it obvious?
Code:
WHERE Username = ''
What should i make from this then?

EDIT: fail, now i see it, let me fix this up..
Thanks alot, i will have to look better in the future

EDIT2: WTF, i shortened my query, because in though that might be it, but still, no result..
Here is my WHERE Username = ' %s' code, and something before it:
pawn Code:
DriversLic = '%d', \
        WeaponLic = '%d', \
        HeavyVLic = '%d', \
        PilotLic = '%d', \
        BlockedPM = '%d',\
        Proposing = '%d',\
        Warnings = '%d'\
        WHERE Username = '%s'",
Reply
#5

The Username you're saving the variable into.

Dynamically, we can't tell you unless you provide code.
Reply
#6

Post where you're formatting the query.
Reply
#7

pawn Code:
new query[1024];
        format(query, sizeof(query), "UPDATE Users SET \
        Money = '%d', \
        Level = '%d', \
        Admin = '%d', \
        Helper = '%d', \
        VipLevel = '%d', \
        Skin = '%d', \
        Kills = '%d', \
        Deaths = '%d', \
        Muted = '%d', \
        Cell = '%d', \
        Cigs = '%d', \
        Watch = '%d', \
        Mask = '%d', \
        GasCan = '%d', \
        Sprunk = '%d', \
        Stereo = '%d', \
        GoldCoins = '%d', \
        PaymentMethod = '%d', \
        DriversLic = '%d', \
        WeaponLic = '%d', \
        HeavyVLic = '%d', \
        PilotLic = '%d', \
        BlockedPM = '%d',\
        Proposing = '%d',\
        Warnings = '%d'\
        WHERE Username = '%s'"
,
        GetPlayerMoney(playerid),
        GetPlayerScore(playerid),
        GetPVarInt(playerid,"Level"),
        GetPVarInt(playerid,"Helper"),
        GetPVarInt(playerid,"Vip Level"),
        GetPVarInt(playerid,"Skin"),
        GetPVarInt(playerid,"Kills"),
        GetPVarInt(playerid,"Deaths"),
        GetPVarInt(playerid,"Muted"),
        GetPVarInt(playerid,"HasCellphone"),
        GetPVarInt(playerid,"HasCigs"),
        GetPVarInt(playerid,"HasWatch"),
        GetPVarInt(playerid,"HasMask"),
        GetPVarInt(playerid,"GasCan"),
        GetPVarInt(playerid,"HasSprunk"),
        GetPVarInt(playerid,"HasStereo"),
        GetPVarInt(playerid,"GoldCoins"),
        GetPVarInt(playerid,"PMethod"),
        GetPVarInt(playerid,"DriversLic"),
        GetPVarInt(playerid,"WeaponLic"),
        GetPVarInt(playerid,"HeavyVLic"),
        GetPVarInt(playerid,"PilotLic"),
        PInfo[playerid][BlockedPM],
        PInfo[playerid][Proposing],
        PInfo[playerid][Warnings],
        PInfo[playerid][Exp],
        PInfo[playerid][Phonebook],
        GetPlayerNameEx(playerid));
        mysql_query(query);
Here it is..
Reply
#8

pawn Code:
PInfo[playerid][Exp],
PInfo[playerid][Phonebook],
GetPlayerNameEx(playerid));
pawn Code:
Proposing = '%d',\
Warnings = '%d'\
WHERE Username = '%s'"
If you didn't catch the mistake, when you're formatting the query, you forgot about Experience, and Phonebook.
Reply
#9

Thanks, I will try this
Reply
#10

Do you know how format works?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)