MySQL Script to SQL ? - 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 Script to SQL ? (
/showthread.php?tid=343894)
MySQL Script to SQL ? -
nGen.SoNNy - 19.05.2012
Hi guys! Can somebody transform this mysql script into SQL ? REP++;
pawn Код:
mysql_store_result();
while(mysql_fetch_row_format(clanquery,"|"))
{
mysql_fetch_field_row(string,"playername");
format(minfo,sizeof(minfo),"%s\n"W"Name: "G"%s",minfo, string);
}
Re: MySQL Script to SQL ? -
[HiC]TheKiller - 19.05.2012
Are you referring to SQLite? You will need to fetch all of the fields separately (no function for the whole row) then use
Db_next_row to loop through all of the results.
Re: MySQL Script to SQL ? -
nGen.SoNNy - 20.05.2012
Can you write the code pls?
I don't understand how to make it
Re: MySQL Script to SQL ? -
Niko_boy - 20.05.2012
Quote:
pawn Код:
mysql_store_result(); while(mysql_fetch_row_format(clanquery,"|")) { mysql_fetch_field_row(string,"playername"); format(minfo,sizeof(minfo),"%s\n"W"Name: "G"%s",minfo, string); }
|
pawn Код:
new DBResult:Result;
Result = db_query( Database, "SELECT * FROM `table` WHERE A CONDITION" );// clan query here
for(new i;i<db_num_rows(Result);i++)
{
new string[30];
db_get_field_assoc(Result, "playername",string, 30);
//db next row to get the next result
format(minfo,sizeof(minfo),"%s\n"W"Name: "G"%s",minfo,string );
db_next_row(Result);
}
Wasn't much hard to understand just give a proper readingwhat said on wiki
Anyways try that code , i dont know SQLite much still try.