SA-MP Forums Archive
Query doesn't work properly - 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: Query doesn't work properly (/showthread.php?tid=609872)



Query doesn't work properly - Sc0pion - 17.06.2016

Fixed!


Re: Query doesn't work properly - Konstantinos - 17.06.2016

Have you checked mysql_log.txt for errors/warnings?


Re: Query doesn't work properly - Sc0pion - 17.06.2016

Fixed!


Re: Query doesn't work properly - Konstantinos - 17.06.2016

After mysql_query calls, print query1 and query2. Get the output and run it through phpmyAdmin to see if it executes the query successful and whether rows were affected.


Re: Query doesn't work properly - Sc0pion - 17.06.2016

Fixed!


Re: Query doesn't work properly - SecretBoss - 17.06.2016

You must change '%d' to %d, I faced the same problem in past while using non-threaded queries

You should only put '' tags to strings, example '%s'

If this won't work check the mysql_log.txt file (if you enabled debugging messages) to see if you got any warnings/errors to your query


Re: Query doesn't work properly - Sc0pion - 17.06.2016

Fixed!


Re: Query doesn't work properly - Konstantinos - 17.06.2016

Quote:
Originally Posted by Sc0pion
Посмотреть сообщение
I put: printf("Query: %s ]",query1);, printf("Query: %s ]",query2);, printf("Query: %s ]",query3); and so on after every mysql_query calls, below is what was printed, I think the codes don't work for a reason.

Код:
[connection] 192.168.1.2:64744 requests connection cookie.
[connection] incoming connection: 192.168.1.2:64744 id: 0
[join] Sc0pion has joined the server (0:192.168.1.2)
[part] Sc0pion has left the server (0:1)
If not printing, then the code is not getting called at all. Where have you placed them?

Quote:
Originally Posted by SecretBoss
Посмотреть сообщение
You must change '%d' to %d, I faced the same problem in past while using non-threaded queries

You should only put '' tags to strings, example '%s'

If this won't work check the mysql_log.txt file (if you enabled debugging messages) to see if you got any warnings/errors to your query
MySQL accepts both.


Re: Query doesn't work properly - Sc0pion - 17.06.2016

Fixed!


Re: Query doesn't work properly - Konstantinos - 17.06.2016

The only thing I can think of is a run time error inside SavePlayerStats function which stops the rest of the code to be called. Please install crashdetect plugin: https://github.com/Zeex/samp-plugin-...etect/releases
and create a file called pawn.cfg into pawno folder. Open the file and write -d3 in it, save it and re-compile your script (gamemode). Connect to the server and disconnect right away, post your server log.

EDIT: Actually for the version you are using, I think errors are not given to the file and that is for debug purposes only - I'm not entirely sure as I have never used a version below R7. Have OnQueryError in your script and print its parameters when it is getting called.