SA-MP Forums Archive
mysql_free_result() - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: mysql_free_result() (/showthread.php?tid=272727)



mysql_free_result() - Ivan_Pantovic - 29.07.2011

Q1: Do I need to use mysql_free_result() to trash unused data or I can work without it and server will trash it(so server won't use too many rams).
Q2: Do I need to use it only when selecting data or when I'm updating/inserting data 2?


Thank you!


Re: mysql_free_result() - Snipa - 29.07.2011

If you mysql_store_result, you need to mysql_clear_result.
So yes, for selecting. Not needed for updating

I accidently forgot to mysql_free_result, and it eventually crashed the server..


Re: mysql_free_result() - JackBauer. - 29.07.2011

Exactly, when you store data, you have to clear it eventually. By updating, inserting or deleting data you don't store any data in the server.


Respuesta: mysql_free_result() - Alex_Obando - 29.07.2011

When you store it, it wont store any date from the server.


Re: mysql_free_result() - Mean - 29.07.2011

pawn Code:
mysql_query( "SELECT * FROM lol WHERE rofl = 'lmao'" );
mysql_store_result( );
// Do all the code here.
// After we are done, we do:
mysql_free_result( );
Also, only when selecting data, actually only when using mysql_store_result( ).


Re: mysql_free_result() - Ivan_Pantovic - 30.07.2011

Quote:
Originally Posted by Mean
View Post
pawn Code:
mysql_query( "SELECT * FROM lol WHERE rofl = 'lmao'" );
mysql_store_result( );
// Do all the code here.
// After we are done, we do:
mysql_free_result( );
Also, only when selecting data, actually only when using mysql_store_result( ).
Hmm, alright.

I did it, now it uses about 100 rams less, but sill by the time it jumps and in about 10 hours it gets to 350 again :/

I'll think of something.

Thank you all very much!

PS. to mean - OMG, kojom brzinom ti skupljas postove ^_^