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 Quote 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? Quote 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
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.