SA-MP Forums Archive
MySQL Foreach help - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: MySQL Foreach help (/showthread.php?tid=164257)



MySQL Foreach help - baske007 - 30.07.2010

Hey guys,

I am going to start on my first MySQL Vehicle Ownership system. It's an easy concept: A table vehicles, with all the neccesary data in it for the car's. Now is my question, how can I make a foreach loop for MySQL?
Like
pawn Код:
Foreach(No idea what here)
{
     UserCar[OWNER] = CreateVehicle(All the neccesary data...);
}
So, I use StrickenKid's plugin.
I know enough MySQL in PAWN, but I have no idea how to use the Foreach function... Or maybe a loop? :S

Thanks,

Bas


Re: MySQL Foreach help - Conroy - 30.07.2010

pawn Код:
for(new vehid; vehid <= MAX_VEHICLES; vehid++) {
//SELECT `X, Y, Z` FROM `vehicles` WHERE `vehicleid' = vehid or whatever
//Then use X, Y, Z to spawn the car
}



Re: MySQL Foreach help - baske007 - 30.07.2010

That is too MySQL intensive. I think there is another better way. Correct me if I'm wrong?
Thanks for the reply...

Bas


Re: MySQL Foreach help - baske007 - 30.07.2010

Bump
Sorry, I really need this, and when your thread is on the second page, you will never get an answer anymore