SA-MP Forums Archive
Query - 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: Query (/showthread.php?tid=514879)



Query - Iillminetor1 - 23.05.2014

Hello,

I'm using SQLITE, and I've a SQLITE Database I want a query to set all user vehiclekey1, vehiclekey2, vehiclekey3, vehiclekey4 and vehiclekey5 to 0

Thank you.


Re: Query - Fred1993 - 23.05.2014

pawn Код:
new msg[2000];
format(msg,sizeof(msg),"UPDATE tablename SET vehiclekey1 = 0, vehiclekey2 = 0, vehiclekey3 = 0, vehiclekey4 = 0,  vehiclekey5, 0 WHERE User = %d", userid);
Is this what you mean ?


Re: Query - Iillminetor1 - 23.05.2014

Got that error "near "new": syntax error: "


Re: Query - Fred1993 - 23.05.2014

Show me the complete error, by the way i have just given you the query .. you need to execute it using
Quote:

mysql_query(msg);

or something. Im not sure about your SQL version commands


Re: Query - Iillminetor1 - 23.05.2014

http://prntscr.com/3lwyxu


Re: Query - Konstantinos - 23.05.2014

He gave you an example so you have to change the name of the table/fields to those you use.

With that program, you can execute queries directly - you don't need the format function at all. All you have to execute for your case is:
pawn Код:
UPDATE table_name SET field_name = 0, field2_name = 0 WHERE field_name = 'some_value or text'



Re: Query - Fred1993 - 23.05.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
He gave you an example so you have to change the name of the table/fields to those you use.

With that program, you can execute queries directly - you don't need the format function at all. All you have to execute for your case is:
pawn Код:
UPDATE table_name SET field_name = 0, field2_name = 0 WHERE field_name = 'some_value or text'
Oh yeah i wasn't sure about the SQLite, but the query was like that though.. also i wasn't sure about his database tables


Re: Query - Iillminetor1 - 23.05.2014

Thanks guys for helping! Repped.