SA-MP Forums Archive
[solved]Converting my old Mysql code to new mysql code.. - 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: [solved]Converting my old Mysql code to new mysql code.. (/showthread.php?tid=568482)



[solved]Converting my old Mysql code to new mysql code.. - Darrenr - 22.03.2015

Hi,

I have been copying my old script (from roughly year and half ago) to my new script. I am having trouble converting over some of my mysql code...

Here is my old code which uses mysql_fetch_row_format()

Code:
    while(mysql_fetch_row_format(result)) {
        sscanf(result, "p<|>ds[24]s[24]s[20]", iNCID, szOldName, szNewName, szTime);
        format(szLargeString, sizeof(szLargeString), "%s\n- (%d) Name: %s (changed from %s, %s)", szLargeString, iNCID, szNewName, szOldName, szTime);
    }
I cant figure out how to re-create this loop through each result with the new functions in the mysql plugin im using...


This is a link to the wiki for the OLD functions: https://sampwiki.blast.hk/wiki/MySQL#mysql_fetch_row_format

This is a link to the wiki for the NEW and CURRENT functions that i'm using: https://sampwiki.blast.hk/wiki/MySQL/R33#Cache_functions

Any ideas?


Re: Converting my old Mysql code to new mysql code.. - Darrenr - 22.03.2015

Solved
Looked through wiki..

realised i need to use Mysql_num_rows in a for() loop....