Jump to content

PHP and MySQL Query


grungefreak

Recommended Posts

I have a small discussion forum. There is a "threads" table in the db and a "topics" table in the db. When a user creates a thread, it is inserted into the "threads" table from the php script. But I want the primary key of that record to be inserted as a foreign key into the "Topics" table. I know this can be done through php but someone suggested that I can set the field in the database to automatically grab the pk of the last thread. Any ideas on how this would be done?

 

GF

Link to comment
https://forums.phpfreaks.com/topic/99597-php-and-mysql-query/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.