Php

They have: 1 posts

Joined: Dec 2012

please tell me query so that form field value insert in both table

They have: 3 posts

Joined: Jan 2013

I have done in my project before like this to insert values in two tables

<?php
$link
= mysql_connect('localhost', 'mysql_user', 'mysql_password', 'database');
mysql_query("INSERT INTO `table1` (`description`) values ('kossu')");
mysql_query("INSERT INTO `table2` (`description_id`, `title`) values (" . mysql_insert_id() . "'kossu')"); );
?>

still if you have any query feel free to ask.

Aditi's picture

They have: 15 posts

Joined: Apr 2013

You have to connect with the database and then you can run two individual queries to insert into two tables, even if the data is to transferred from a single form, it does never creates problem.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.