mdvignesh Posted June 7, 2012 Share Posted June 7, 2012 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 More sharing options...
scootstah Posted June 7, 2012 Share Posted June 7, 2012 You don't have to change anything on your INSERT query to use foreign keys. Is your query not working? Link to comment https://forums.phpfreaks.com/topic/263813-how-to-use-foriegn-key-in-insert-query/#findComment-1351887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.