Script Select user and add data

mraresh

Newbie
Joined
May 5, 2016
Messages
14
Reaction score
1
Hello.
I want to Make a script with 2 tabels in My database .
1. user
2. cars

What i want to do?!

Search SPECIFIC NAME in my db , and after i select that name , to add his car and insert in table CARS .

Best regards.
 
Maybe you can add some further information.

Which Database do you use?
Which script language do you want to use?

What should be the userinterface for the search?

Best luck
Mf
 
Hello.
I want to Make a script with 2 tabels in My database .
1. user
2. cars

What i want to do?!

Search SPECIFIC NAME in my db , and after i select that name , to add his car and insert in table CARS .

Best regards.
OK, so?
 
I dont know how to implement thoose tables One in other !
 
This is a classic 1-to-many relationship with every person can have many cars but one car is only linked to one person. (Otherwise you would have a n-to-m relationship which would need an other table to join both entities)
Easiest way for the simple scenario is to add a user ID (autoincrement / sequel) to table user and to add it also to the table cars.
 
If you use MYSQL Database then the most easiest way for such query is:

jud5df.jpg


(the variables can be different depending in what language you want to use it).

P.S. I had to put an image because BHW is giving me "You have been blocked" message if I enter the code directly.
 
Back
Top