Jump to content

[MySQL/SQLite]Table in Table ?


Tekken

Recommended Posts

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 by Guest
Link to comment
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

 

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

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 by Guest
Link to comment
  • MTA Team

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...