SA-MP Forums Archive
MySQL R40 Updating, few problems... - 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: MySQL R40 Updating, few problems... (/showthread.php?tid=624638)



MySQL R40 Updating, few problems... - SkyFlare - 20.12.2016

Hi guys, I am trying to update MYSQL to R40+
mostly done but just this small bit left.

Код:
gamemodes\SRP.pwn(8489) : error 017: undefined symbol "mysql_store_result"
gamemodes\SRP.pwn(8490) : error 017: undefined symbol "mysql_num_rows"
gamemodes\SRP.pwn(8491) : error 017: undefined symbol "mysql_fetch_row_format"
Here is 8489
Код:
mysql_store_result();
Here is 8490
Код:
if(mysql_num_rows())
Here is 8491
Код:
if(mysql_fetch_row_format(query,"|"))
I checked a few tutorials on updating to R40 but it just didn't do any justice.

I am pretty sure this is something small.
I am very unfamiliar with MySQL and still learning, so please don't laugh too hard at my mistakes lol.
Anyone able to push me in the right direction here please?


Re: MySQL R40 Updating, few problems... - SkyFlare - 20.12.2016

Instead of making a new Thread I am going to bump this, I still have not found my solution.


Re: MySQL R40 Updating, few problems... - BiosMarcel - 20.12.2016

You are using non existant methods ... what do you expect, search for the new equivalents


Re: MySQL R40 Updating, few problems... - SkyFlare - 20.12.2016

Quote:
Originally Posted by [Bios]Marcel
Посмотреть сообщение
You are using non existant methods ... what do you expect, search for the new equivalents
Of course it is non existent methods, although I have been searching, I couldn't even find documentation for these methods.


Re: MySQL R40 Updating, few problems... - BiosMarcel - 20.12.2016

Just look at your code try and guess what it is supposed to do and recode it in version R40 code


Re: MySQL R40 Updating, few problems... - Konstantinos - 20.12.2016

What I can advise you is to learn how to use R40+ first (get familiar with its functions) and when the time will come to convert your code will be piece of cake.

mysql_store_result is somewhat similar to saving the cache-id (what mysql_query returns) but don't! Use threaded queries instead (look in wiki for mysql_tquery).

mysql_num_rows -> cache_num_rows

mysql_fetch_row_format is nothing to be compared with. Assuming you'd use sscanf to fetch the result, here you use cache_get_value/cache_get_value_int/cache_get_value_float functions to retrieve the data from the columns.

MySQL Wiki: https://sampwiki.blast.hk/wiki/MySQL/R40
Example script: https://raw.githubusercontent.com/pB...stem-cache.pwn


Re: MySQL R40 Updating, few problems... - SkyFlare - 21.12.2016

Interesting, thanks for this Konstantinos.