Answer the question
In order to leave comments, you need to log in
How to make a connection in the database?
Good evening.
I can't figure out the relationships in the database.
There is table_1(id,name) and table_2(user_id, param_1,param_2)
I can’t figure out how to do the following: when adding a person to table_1, at that moment a record was created in table_2, and such that user_id = id (from table_1) and created param_1,param_2 for this user_id.
Tell me how to implement this, or direct - in which direction to look?)
Answer the question
In order to leave comments, you need to log in
$query = mysql_query("INSERT INTO orders_in_shop (id_client, price_order, status, data_order) VALUES ('$id_client','$price','$status', '$data')");
$id_order_in_shop = mysql_insert_id();
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question