MySQL Help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL Help (
/showthread.php?tid=585540)
MySQL Help -
SamJust - 14.08.2015
Код:
stock SaveBizz()
{
new req[1024];
format(req, sizeof(req), "UPDATE `bussines` SET `Owned` = '%i', `Owner` = '%s', `Bank` = '%i', `Prod` = '%i', `Upgrade` = '%i', `WorkerPay` = '%i', `ManagerPay` = '%i' WHERE `ID` = %i",
BizzInfo[0][bOwned], BizzInfo[0][bOwner], BizzInfo[0][bBank], BizzInfo[0][bProd], BizzInfo[0][bUpgrade], BizzInfo[0][bWP], BizzInfo[0][bMP], BizzInfo[0][bID]);
mysql_query(req, -1, 0, MySQL);
return 1;
}
So, as I planned, when u call this function it saves info about Bizz[0][...] to DB. But it doesn't. What am I doing wrong?
MySQL v5.5
Re: MySQL Help -
Dziugsas - 14.08.2015
Show us mysql log
Re: MySQL Help -
SamJust - 14.08.2015
MySQL log:
Код:
[00:02:04] >> mysql_connect(localhost, root, server, ******) on port 3306
[00:02:04] CMySQLHandler::CMySQLHandler() - constructor called.
[00:02:04] CMySQLHandler::CMySQLHandler() - Connecting to "localhost" | DB: "server" | Username: "root"
[00:02:04] CMySQLHandler::Connect() - Connection was successful.
[00:02:04] CMySQLHandler::Connect() - Auto-Reconnect has been enabled.
[00:02:04] >> mysql_ping( Connection handle: 1 )
[00:02:04] CMySQLHandler::Ping() - Connection is still alive.
[00:02:04] >> mysql_query_callback( Connection handle: 1 )
[00:02:04] Passing query SELECT * FROM `bussines` |
[00:02:04] ProcessQueryThread(LoadBizz) - Query was successful. (SELECT * FROM `bussines`)
[00:02:04] ProcessQueryThread(LoadBizz) - Data caching enabled.
[00:02:04] CMySQLHandler::StoreResult() - Result was stored.
[00:02:04] CMySQLHandler::FreeResult() - Result was successfully free'd.
[00:02:04] CMySQLHandler::ProcessQueryThread() - Data is getting passed to ->ProcessTick()
[00:02:04] LoadBizz() - Threaded function called.
[00:02:04] >> cache_get_data( Connection handle: 1 )
[00:02:04] ProcessTick() - The cache has been cleared.
[00:02:42] >> mysql_query_callback( Connection handle: 1 )
[00:02:42] Passing query UPDATE `bussines` SET `Owned` = '1', `Owner` = 'Augustin_Ocasio', `Bank` = '1', `Prod` = '1', `Upgrade` = '2', `WorkerPay` = '6', `ManagerPay` = '10' WHERE `ID` = 1 | siii
[00:02:42] CMySQLHandler::ProcessQueryThread() - Error will be triggered to OnQueryError()
[00:02:42] OnQueryError() - Called.
[00:02:49] >> mysql_close( Connection handle: 1 )
[00:02:49] CMySQLHandler::~CMySQLHandler() - deconstructor called.
[00:02:49] CMySQLHandler::FreeResult() - The result is already empty.
[00:02:49] CMySQLHandler::Disconnect() - Connection was closed.
[00:02:49] Unloading Plugin
Re: MySQL Help -
SamJust - 15.08.2015
Up!!
Re: MySQL Help -
MarvinPWN - 15.08.2015
Try this:
PHP код:
mysql_query(req, -1, 0, MySQL);
to
PHP код:
mysql_query(req,MySQL);
Re: MySQL Help -
SamJust - 15.08.2015
Tried, I couldnt even compile it like that.
Re: MySQL Help -
SamJust - 15.08.2015
Up once more, cause I can't solve the problem myself.
Re: MySQL Help -
BlackBank - 16.08.2015
What would happened if you change this:
PHP код:
mysql_query(req, -1, 0, MySQL);
to this:
PHP код:
mysql_query(req, .connectionHandle=MySQL);
Does the error still occurred?
Re: MySQL Help -
SamJust - 16.08.2015
I'll try.
Re: MySQL Help -
SamJust - 19.08.2015
Up..