Worked before for me, but now when a query runs, it runs it but doesn't run function on onSuccess.
grrr getting frustrated atm off it.
Anyone any thoughts why It runs the query but not runs the onSuccess?
I like MySqloo, but it seems like it's half broke atm.. Try tmysql
[QUOTE=Trivkz;24777737]I like MySqloo, but it seems like it's half broke atm.. Try tmysql[/QUOTE]
tmysql any stable? and a link somewhere?
[QUOTE=WaterRatj;24777597]Worked before for me, but now when a query runs, it runs it but doesn't run function on onSuccess.
grrr getting frustrated atm off it.
Anyone any thoughts why It runs the query but not runs the onSuccess?[/QUOTE]
Are you sure the query is even working? Use onFailure and onError to ensure that. It's not half buggy by the way, it works perfectly fine.
[editline]03:38PM[/editline]
[lua]
local MyQuer = database:query("query")
MyQuer.onSuccess = function() print("Woo, Query worked!") end
MyQuer.onFailure = function(Q,F) print("Query Failed :( Error: "..F) end
MyQuer.onError = function(Q,F) print("Query Error'd :( Error: "..F) end
MyQuer:start()[/lua]
[QUOTE=Teddi Orange;24778123]Are you sure the query is even working? Use onFailure and onError to ensure that. It's not half buggy by the way, it works perfectly fine.[/QUOTE]
Yeah I thought so to, in the beginning worked, don't understand why i'm restarting my gamemode it doesn't work.
OnFailure and onError don't run anything and the query is run, cause the database is updated when I use insert, just doesn't run the onSuccess function or on failure and all
use Query:onData to check if any data is being recieved.
[QUOTE=Teddi Orange;24778205]use Query:onData to check if any data is being recieved.[/QUOTE]
onData does't show anything neither
Are you even telling the query to start? While you're at it, post your code below.
[QUOTE=Teddi Orange;24778288]Are you even telling the query to start? While you're at it, post your code below.[/QUOTE]
This is my mysql.lua file
[url]http://pastebin.com/YQemczY5[/url]
That (in my opinion) is a tad elaborate, but eh. Just a few pointers-
[list=]
[*]You don't need to call wait, the connection should automatically sleep when it's not in use.
[*]Needs more onError / onFailure (in my opinion, just for the sake of debugging if needs be)
[/list]
The only thing I can really see wrong there is that your query may be incorrect.
[QUOTE=Teddi Orange;24779077]That (in my opinion) is a tad elaborate, but eh. Just a few pointers-
[list=]
[*]You don't need to call wait, the connection should automatically sleep when it's not in use.
[*]Needs more onError / onFailure (in my opinion, just for the sake of debugging if needs be)
[/list]
The only thing I can really see wrong there is that your query may be incorrect.[/QUOTE]
I added both the onError,onFailure, If my query is incorrect, then why does it execute it?
[QUOTE=WaterRatj;24779149]I added both the onError,onFailure, If my query is incorrect, then why does it execute it?[/QUOTE]
-snip-
[QUOTE=Teddi Orange;24779210]-snip-
Ignore the above, onSuccess should still be called even if there's no data.[/QUOTE]
If you say it's because of no Data is returned, then how can you check is query is successfull but just not data returned?
Also when it should return a row, it still doesn't execute the onSuccess function
Well why onSucess isn't being called I don't know. It should call one of three (four if you include onData), those being onSuccess, onError and onFailure. Only suggestion I can think of is reinstall the modules.
[QUOTE=Teddi Orange;24779308]Well why onSucess isn't being called I don't know. It should call one of three (four if you include onData), those being onSuccess, onError and onFailure. Only suggestion I can think of is reinstall the modules.[/QUOTE]
I'll try that, but strange that it actually executes the query but not return success as it should
[editline]06:10PM[/editline]
Tried my old code and new, both give same problem, the mysql module is prolly broken due to last garrysmod update
I Really could use a fix so I can use mysql, cause I really really need mysql
MySQLOO broke entirely for me, refuses to connect no matter what.
[QUOTE=Drakehawke;24788921]MySQLOO broke entirely for me, refuses to connect no matter what.[/QUOTE]
Hmm seems strange, My code also worked a week or two ago, now it seems its also broken.
It exectes queryies but doesn't run the onSuccess one, strange!
hope someone can fix this or that andy comes online!
MySQLOO is just a horrible module, hardly works. I recommend using gm_tmysql from AzuIsLeet, it works perfectly and it connects without a hitch, I use it on all my servers.
[QUOTE=Kopimi;24789839]MySQLOO is just a horrible module, hardly works. I recommend using gm_tmysql from AzuIsLeet, it works perfectly and it connects without a hitch, I use it on all my servers.[/QUOTE]
But is it easy to use? and stable? Any tutorials? examples? and where can I find latest?
People should stop hating on mysqloo. It works pretty well as long as you're using the latest version. I've had absolutely no issues with it, nor have most people that I know of.
[editline]02:11AM[/editline]
Though I do agree the fact that it tries to query even though you've checked the connection does't exist is a tad stupid.
[QUOTE=Teddi Orange;24792280]People should stop hating on mysqloo. It works pretty well as long as you're using the latest version. I've had absolutely no issues with it, nor have most people that I know of.
[editline]02:11AM[/editline]
Though I do agree the fact that it tries to query even though you've checked the connection does't exist is a tad stupid.[/QUOTE]
Can you give me an example with the latest version then, how to get a "select * from blabla" with onsuccess running its function?
Cause I would like to use mysqloo if it would work like it use to.
I do the following when a player connects to the server:
[lua]local PlyData = database:query("SELECT `columns` FROM `userstable` WHERE `steam` = '"..pl:SteamID().."'")
PlyData.pl = pl
PlyData.onSuccess = ReturnFunction
PlyData.onFailure = function(Q,F) print("Failed to load "..pl:Nick().."'s user data. Error: "..F) end
PlyData.onError = function(Q,F) print("###QUERY ERROR: "..F) end
PlyData:start()[/lua]That is exact function I use, bar the missing columns / table. I don't do any checks because the status function appears to be bugged. Even if there isn't a connection, for some reason (for me at least) it returns always that there is one. This is all with the latest version of myslqoo (v7).
[QUOTE=Teddi Orange;24800642]I do the following when a player connects to the server:
[lua]local PlyData = database:query("SELECT `columns` FROM `userstable` WHERE `steam` = '"..pl:SteamID().."'")
PlyData.pl = pl
PlyData.onSuccess = ReturnFunction
PlyData.onFailure = function(Q,F) print("Failed to load "..pl:Nick().."'s user data. Error: "..F) end
PlyData.onError = function(Q,F) print("###QUERY ERROR: "..F) end
PlyData:start()[/lua]That is exact function I use, bar the missing columns / table. I don't do any checks because the status function appears to be bugged. Even if there isn't a connection, for some reason (for me at least) it returns always that there is one. This is all with the latest version of myslqoo (v7).[/QUOTE]
so the return function is executed?
Yes. The easiest way to check this is to do something like this.
[lua]
function ReturnData(self)
self.data = self:getData()
PrintTable(self.data)
end
[/lua]
[editline]03:01PM[/editline]
You don't need the parenthesis, just the function name.
[editline]03:01PM[/editline]
When putting the callback in onSuccess that is.
[QUOTE=Teddi Orange;24800800]Yes. The easiest way to check this is to do something like this.
[lua]
function ReturnData(self)
self.data = self:getData()
PrintTable(self.data)
end
[/lua]
[editline]03:01PM[/editline]
You don't need the parenthesis, just the function name.
[editline]03:01PM[/editline]
When putting the callback in onSuccess that is.[/QUOTE]
Let me try a few things and see if it works, hope it will, cause can't work further on my gm when mysql doesn't work ^^
[editline]04:11PM[/editline]
Still doesn't run the onSuccess ...
Why is this happening, it's driving me crazy ^^
[QUOTE=WaterRatj;24800900]Let me try a few things and see if it works, hope it will, cause can't work further on my gm when mysql doesn't work ^^
[editline]04:11PM[/editline]
Still doesn't run the onSuccess ...
Why is this happening, it's driving me crazy ^^[/QUOTE]
The only other thing I can think of is that you (somehow) changed how the database itself functions.
[QUOTE=Teddi Orange;24800961]The only other thing I can think of is that you (somehow) changed how the database itself functions.[/QUOTE]
I din't change anything, thats the strange part.
Also query is running, it add the data in table just not executing the function, it worked a week or two ago, with exact same code.
[QUOTE=WaterRatj;24801009]I din't change anything, thats the strange part.
Also query is running, it add the data in table just not executing the function, it worked a week or two ago, with exact same code.[/QUOTE]
I'm out of ideas really, the only thing to do would be to contact andy and see what he thinks of it.
[QUOTE=Teddi Orange;24801175]I'm out of ideas really, the only thing to do would be to contact andy and see what he thinks of it.[/QUOTE]
yeah but seems hes not been on since july, and of others have problem with it to.
I'll wait till he updates it, for now i'll try tmysql, and return to mysqloo when it works for me, if andy updates it
Its sad a bit since it use to work for me, and din't change anything since then, only an update for garrysmod
Sorry, you need to Log In to post a reply to this thread.