SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 22/03/2015, 02:59 PM   #1
Darrenr
Big Clucker
 
Darrenr's Avatar
 
Join Date: Mar 2015
Posts: 90
Reputation: 13
Default [solved]Converting my old Mysql code to new mysql code..

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: http://wiki.sa-mp.com/wiki/MySQL#mysql_fetch_row_format

This is a link to the wiki for the NEW and CURRENT functions that i'm using: http://wiki.sa-mp.com/wiki/MySQL/R33#Cache_functions

Any ideas?
__________________
PM me for help with scripting in Pawn.








rep+

Last edited by Darrenr; 22/03/2015 at 03:05 PM. Reason: Solved
Darrenr is offline   Reply With Quote
Old 22/03/2015, 03:05 PM   #2
Darrenr
Big Clucker
 
Darrenr's Avatar
 
Join Date: Mar 2015
Posts: 90
Reputation: 13
Default Re: Converting my old Mysql code to new mysql code..

Solved
Looked through wiki..

realised i need to use Mysql_num_rows in a for() loop....
__________________
PM me for help with scripting in Pawn.








rep+
Darrenr is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
HELP: Old code MySQL R5 -> MySQL R34. How to re-write it according to new one? Caupo Scripting Help 0 25/02/2015 09:10 AM
Converting this Small Code from MYSQL into Dini. Goosie Scripting Help 4 13/02/2015 08:27 AM
Help with this mysql code Kratory Scripting Help 8 12/05/2014 04:02 PM
mysql code jcvag44800 Scripting Help 10 07/05/2014 10:41 AM


All times are GMT. The time now is 11:24 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.