Getting vehicle ID from a mysql query
#4

Quote:
Originally Posted by Abreezy
Посмотреть сообщение
Alright for the
pawn Код:
format(query, sizeof(query), "SELECT * FROM Vehicles WHERE Plate = \'%s\'", plate);
Whats the
pawn Код:
\'%s\'
I've only done '%s' before, whats the difference?
The \ is an escape character, you are supposed to escape quotes (', ") in SQL queries to avoid SQL injection. It's important in this situation, because you're directly taking a player's input into a query.
Quote:
Originally Posted by Abreezy
Посмотреть сообщение
Also, just to ensure im not stupid, I could then go about by doing something like

pawn Код:
Vehicles[model][Ownername]
Or would that not work?
What EXACTLY is the purpose of this vehicleinfo command? Are you trying to load cars from a table and store their values into variables, or just fetch data from the table to show in a clientmessage?
Reply


Messages In This Thread
Getting vehicle ID from a mysql query - by Abreezy - 12.10.2012, 04:32
Re: Getting vehicle ID from a mysql query - by ReneG - 12.10.2012, 04:48
Re: Getting vehicle ID from a mysql query - by Abreezy - 12.10.2012, 04:52
Re: Getting vehicle ID from a mysql query - by ReneG - 12.10.2012, 05:10
Re: Getting vehicle ID from a mysql query - by Abreezy - 12.10.2012, 05:33

Forum Jump:


Users browsing this thread: 1 Guest(s)