how to select from one database and insert into another Database in a Single query with different Database connections in php
===

    mysql_connect("localhost","root","");
    mysql_select_db("database1");
    mysql_query("INSERT INTO database2.categories (category_name,description,group_id,created)
    SELECT table1.name ,table1.description,12,UNIX_TIMESTAMP()
    FROM GiveArang_categories Where `p_id`= '225' ");




> I Need to Insert the datas into the second database Which is Selected from the First database 
> The Two database Having Different Connections .
> Need to done in php in a single query . 