im using mysql, these are two tables i have:
posts {id, user_id, post, date}
post_tags {id, tag, post_id(references id in post), user_id}
what im trying to do is if the post has a #tag , i insert the intial post in the POSTS table, and the data in the post_tags table, how could i do that simlateanously?
P.S. i already know how to check if a post has a tag!! i just want to undertand, how can insert data into both!! espcially the ID’s because they are generated within mysql(autoincrement)!!
You can seperate these two queries and run them after each other. You can use mysql_insert_id() for the last inserted id in an table.