Click here to Skip to main content
15,893,487 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My Problem is How to add values into table2 based on the id column in table1 in Php


Table1:tbl_Projects(Pid(auto-increment),Pname,PNo)

Table2:tbl_AddfloorPlans(pid,FloorNo,MapUrl)(Note:Pid not inserting from front end)
How to do this in php

Please Help me
Posted

1 solution

PHP
if u just want id from table1 then simply do this.

global $sid;
$r = mysql_query("select id from tbl1);
        while($id1 = mysql_fetch_array($r))
        {
            $sid = $id1['Id'];

        }
.//

now insert retrived value to your table2
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900