MySQL Saving and Loading -
'Pawno. - 19.06.2012
Hello.
I had an simple problem, so if i want to load and save some things it doesnt do that.
but this problem is only on my server at
www.nitrado.net (german hoster)
if i start my script on my computer, it works!
here's some code:
pawn Код:
public SaveInfos()
{
mysql_SetInt("infotab", "Bestand", lagerbestand, "Info", "Lager");
mysql_SetInt("infotab", "Bestand", Kasse[Staat], "Info", "StaatsKasse");
mysql_SetInt("infotab", "Bestand", Kasse[Samd], "Info", "SAMDKasse");
mysql_SetInt("infotab", "Bestand", Kasse[Sana], "Info", "SANAKasse");
mysql_SetInt("infotab", "Bestand", Kasse[Oamt], "Info", "OAMTKasse");
mysql_SetInt("infotab", "Bestand", Kasse[Grove], "Info", "GSKasse");
mysql_SetInt("infotab", "Bestand", Kasse[Ballas], "Info", "BALLASKasse");
mysql_SetInt("infotab", "Bestand", Kasse[Fahrschule], "Info", "SchulKasse");
}
public LoadInfos()
{
lagerbestand = mysql_GetInt("infotab", "Bestand", "Info", "Lager");
Kasse[Staat] = mysql_GetInt("infotab", "Bestand", "Info", "StaatsKasse");
Kasse[Samd] = mysql_GetInt("infotab", "Bestand", "Info", "SAMDKasse");
Kasse[Sana] = mysql_GetInt("infotab", "Bestand", "Info", "SANAKasse");
Kasse[Oamt] = mysql_GetInt("infotab", "Bestand", "Info", "OAMTKasse");
Kasse[Grove] = mysql_GetInt("infotab", "Bestand", "Info", "GSKasse");
Kasse[Ballas] = mysql_GetInt("infotab", "Bestand", "Info", "BALLASKasse");
Kasse[Fahrschule] = mysql_GetInt("infotab", "Bestand", "Info", "SchulKasse");
}
Kasse (it's german) = cashbox.
lagerbestand (it's german too) = stock
my mysql_GetInt function:
pawn Код:
stock mysql_GetInt(Table[], Field[], Where[], Is[])
{
new query[128];
mysql_real_escape_string(Table, Table);
mysql_real_escape_string(Field, Field);
mysql_real_escape_string(Where, Where);
mysql_real_escape_string(Is, Is);
format(query, 128, "SELECT `%s` FROM `%s` WHERE `%s` = '%s'", Field, Table, Where, Is);
mysql_query(query);
mysql_store_result();
new sqlint = mysql_fetch_int();
mysql_free_result();
return sqlint;
}
So, here are 2 screens of the table on the server and on my localhost.
server:
Sorry, its german but u can use the ****** translator.
localhost:
I hope you can help me.
Re: MySQL Saving and Loading -
Sergei - 19.06.2012
You are just doing it wrong. One query for loading and one for saving is what you need. This is MySQL not some ini filesystem.
Re: MySQL Saving and Loading -
'Pawno. - 19.06.2012
What did you mean?
I use the r5 plugin by blueG. (r7 doesnt work on my script o.O)
The player-table is working very good, the other tables too, but only the infotable not!
Re: MySQL Saving and Loading -
FUNExtreme - 19.06.2012
What you are saying is that it saves on your localhost but not where you have a paid server..
Is it possible that your host uses Linux and that you didn't upload the correct plugin? Also.. On linux plugins should be put in the server.cfg like this => plugins mysqlplugin.so (Please note the .so)
Re: MySQL Saving and Loading -
'Pawno. - 19.06.2012
I had uploaded the right plugin. r5 from blueg. :/
Re: MySQL Saving and Loading -
FUNExtreme - 19.06.2012
r7 won't work because you don't use threaded mysql. What about r6?
Re: MySQL Saving and Loading -
'Pawno. - 19.06.2012
hm, i try it.
Re: MySQL Saving and Loading -
'Pawno. - 19.06.2012
So, if i want to use the r6, it doesnt connect and it closes the console
I have looked into the server_log and it says me:
[14:10:21] Loading plugin: mysql
[14:10:21]
> MySQL plugin R5 successfully loaded.
But i have the r6 ... ?
Any help? :/