MySQL multirow
#2

You should use escape strings instead of regular strings to prevent MYSQL injections (%e).


Код:
format(string, sizeof(string), "SELECT * FROM vehicles WHERE Owner = '%s'", Name(playerid));
In this code you're selecting all data. If you just want the vehicle model ID then you only need to select that row.

Код:
format(string, sizeof(string), "SELECT `vehiclemodel` FROM `vehicles` WHERE `Owner` = '%e'", Name(playerid));
But ideally all of this data should be loaded once a player logs in, and since this player is online you could just use the variables from the script rather than a MYSQL query.
Reply


Messages In This Thread
MySQL multirow - by mike_1 - 11.12.2014, 18:23
Re: MySQL multirow - by Divergent - 11.12.2014, 20:10

Forum Jump:


Users browsing this thread: 1 Guest(s)