Tekken Posted April 26, 2015 Share Posted April 26, 2015 I want to create a vehs table and in that table to store more vehs like this: dbQuery(db, "CREATE TABLE IF NOT EXISTS vehs (veh1(x,y,z), veh2(x,y,z))") Can i do that in any way ? Link to comment
WhoAmI Posted April 26, 2015 Share Posted April 26, 2015 You can create the column "type" and insert the "1" or "2". Depends what type of vehicle you want to insert. Link to comment
Tekken Posted April 26, 2015 Author Share Posted April 26, 2015 You can create the column "type" and insert the "1" or "2". Depends what type of vehicle you want to insert. Can you make an example please ? Link to comment
Tekken Posted April 26, 2015 Author Share Posted April 26, 2015 Try to use toJSON () Example please ? Link to comment
Walid Posted April 26, 2015 Share Posted April 26, 2015 Try to use toJSON () Example please ? ToJSON Link to comment
Irish Posted April 26, 2015 Share Posted April 26, 2015 (edited) dbQuery(db, "CREATE TABLE IF NOT EXISTS vehs (veh1 TEXT, veh2 TEXT, x INTERGER, y INTEGER, z INTEGER) You can use only one "x,y,z" for both vehicles, but always remember that you select by veh1 or veh2. replace "TEXT" with "INTEGER" if integer doesn't works. Example for veh1: dbExec("INSERT INTO vehs SET x=?, y=?, z=? WHERE veh1=?", x, y , z, veh1 ) Example for veh2: dbExec("INSERT INTO vehs SET x=?, y=?, z=? WHERE veh2=?", x, y , z, veh2 ) You must create identified variable for both, veh1 and veh2. The only change between both codes are "veh1" or "veh2". Edited April 26, 2015 by Guest Link to comment
Walid Posted April 26, 2015 Share Posted April 26, 2015 I think you must read the first post he is asking about : I want to create a vehs table and in that table to store more vehs Link to comment
Irish Posted April 26, 2015 Share Posted April 26, 2015 I think you must read the first post he is asking about :I want to create a vehs table and in that table to store more vehs And you must know he asked for an example. I'm not supposed to create those more vehs column for him. Those two "veh1" and "veh2" are enough. If he wants to store more vehicles in it, then he can do it right the way shown in example. Just add another "veh3" column for storing another veh. @Walid, if you think like that, then I think you must use your brain. Honestly I'm not here to show off my skills. I've intention to help people if I know the solution to the problem, not as like you to give random/unwanted/useless help. Link to comment
Irish Posted April 26, 2015 Share Posted April 26, 2015 (edited) This post was replied twice with mistake. If possible remove this, please. Edited April 26, 2015 by Guest Link to comment
Walid Posted April 26, 2015 Share Posted April 26, 2015 why he need to use veh1 , veh2 hhh it can be like this dbQuery(db, "CREATE TABLE IF NOT EXISTS vehs (vehicle TEXT, x INTERGER, y INTEGER, z INTEGER) Print : 1. vehicle , x , y , z 2. vehicle2 , x , y , z 3. vehicle3 , x , y , z etc ... Link to comment
Irish Posted April 26, 2015 Share Posted April 26, 2015 (edited) mihayy5 asked regarding adding more vehicles in the table (STAY ON THE TOPIC). I won't start an bullshit argument with you. Also I will not reply to your post anymore unless its necessary. @ mihayy5 take the help of anyone who's code works for you. Of course, no matter who he is. EDIT: @Walid Stop PMing me and threatening me regarding your server. I don't care even 1% of your server so calm down. If you send me another PM like that then I will possibly report you. Edited April 28, 2015 by Guest Link to comment
Tekken Posted April 26, 2015 Author Share Posted April 26, 2015 I mean this : Soryy, but i don't know a beter way to explain. Link to comment
MTA Team botder Posted April 26, 2015 MTA Team Share Posted April 26, 2015 Do you even understand what (My-)SQL is offering you? Probably not. 'vehs' (a very ugly shortage) will be your SQL table. Each 'veh' ("vehicle") is a row in your SQL table. You need to create columns in that SQL table, which will e.g. save your X, Y, Z coordinates for each row (each vehicle). Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now