I am designing a database, and need a statement inserting values into two tables at a time. The issue for me doing so, is the fact that one of the tables will need a value, which is autoincremented in the other. How can I do this? My host does not support the use of foreign keys unfortunately. (I am using mySQL)
I've put the table names and values below.
Task
+ id (auto incremented value)
+ dataid (should have been foreign key to data.id- which will be auto incremented when +tatement is xecuted)
+ priority (task priority 1-100)
+ statusid (should have been foreign key to status.id - this value is given)
+ toc (TimeOfCreation - timestamp, will be set automatically)
Data
+ id (auto incremented value)
+ text (the text of the task/privatemsg/statusmsg etc.)
Can one or someone of you help me make an insert statment making it possible for me to insert this data into these tables, where data.id is auto incremented, and stored in task.dataid?
text=fix login
priority=99
statusid=4
Please ask if you have any questions.
Thanks in advance
Pyracell