Does it exist
#1

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??
Reply
#2

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
Reply
#3

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.
Reply
#4

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?
Reply
#5

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.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)