I have two questions when designing a backend for a site I'm working on.
I am a bit confused on the format for the Last_Insert_ID() function. I find a bit of information, but still am confused. Given the structure below, how would I insert into the Business table and the Business_Category table? Is there more than one sql statement needed here?
Also, now let's say I want to delete someone from this list. They need to be deleted from both the Business and the Business_Category table. The business might sometimes be linked to more than one category... Is this two sql statements as well, with a loop for the category deletes
Buisnes table
+-----+--------------------------------+------------------------------+------------
| bid | b_name | b_address | b_city | b_state | b_zip | b_county | ...
+-----+--------------------------------+------------------------------+------------ ...
| 2 | ARBY'S | 9326 HIGHWAY 49 | GULFPORT | MS | 39503 | HARRISON | ...
Category table
+-----+-----------------------
|cid | name | parent|
+-----+-----------------------
|1 | RESTAURANT | NULL |
Business_Category table
+-----+------
|cid | bid |
+-----+------
|1 | 2 |