Im doing a PHP script for insert in the table A values recovered from the table B (A and B are in different databases).
Table A Columns
[index(autoincrement),timestamp(currenttimestamp),col1,col2,.....col15]
and I have the query for retrieve the values from B:
$query= "select count(*) as col1, XXX as col2.....ZZZ as col15 from B";
so having the
$row=$mysql_fetch_array($result)
where
$result=mysql_query($query)
how can I make an
insert into A (col1,col2.....col15) values ($row['col1'],....$row['col15'];
easily without write all the code? Thanks
1 Answer