SA-MP Forums Archive
Does it exist - 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: Does it exist (/showthread.php?tid=621681)



Does it exist - Micko123 - 13.11.2016

So I want to check does Id of that org exist. With Yini it is like this
PHP код:
if(fexist(orgfile)).. 
But how it goes with MySQL R41??


Re: Does it exist - SyS - 13.11.2016

Do a query and if no rows appears (0) in result then yeah it doesn't exists
https://sampwiki.blast.hk/wiki/MySQL/R40..._get_row_count
https://sampwiki.blast.hk/wiki/MySQL/R40...t_result_count


Re: Does it exist - SickAttack - 13.11.2016

Execute a SELECT statement with LIMIT 1, get the row count, and if it's 0 then it doesn't exist, if it's 1 then it does.


Re: Does it exist - Micko123 - 13.11.2016

But listen. I want to edit name of organizations. type is /editname [ID][New Name].
That is the way how I check for ID right?? It is same?


Re: Does it exist - Vince - 13.11.2016

If you don't want to check if it exists beforehand then you can use affected_rows() afterwards to check if the update was completed or not.


Re: Does it exist - Micko123 - 13.11.2016

But I want to check does ID of that org exist so I can edit its name, spawn and so on.. How to do I. I toight I know but I don't xD