Jump to content

how to use foriegn key in insert query


mdvignesh

Recommended Posts

how to use foriegn key in insert query

 

I am having a comment form for each video like youtube

 

having 2 tables one for video details and one for comments

 

insert into cae_comments (c_id,comments_date,comments,approve_com) values ('".$_REQUEST['id']."','".date("Y-m-d")."' ,'".trim($_POST['txtarea'])."',NULL)

 

i set c_id as foreign key

 

and primary key v_id in 2nd table

 

Link to comment
https://forums.phpfreaks.com/topic/263813-how-to-use-foriegn-key-in-insert-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.