$ Mssql_link = mssql_connect ($ db_host, $ db_msuser, $ db_mspass) or Die ("mssql database connection failed "); Mssql_select_db ($ db_msname, $ mssql_link ); $ Mysql_link = mysql_connect ($ db_myhost, $ db_myuser, $ db_mypass) or die ("mysql database connection failed". mysql_error ()); Mysql_select_db ($ db_myname, $ mysql_link ); $ Msquery = mssql_query ("select top 1 * from buyok_produc", $ mssql_link ); $ Vars = "; $ Vals = "; $ Cols = "; While ($ row = mssql_fetch_array ($ msquery, $ mssql_link )){ $ Vals = "; Foreach ($ row as $ key => $ values ){ $ Cols. = ($ cols = "? $ Key: ','. $ key ); $ Vals. = ($ vals = "? '''. $ Values. '', ': '''. $ values .'','); // Echo $ vals; } $ Vars. = ($ vars = "? '('. $ Vals. ')': ', ('. $ vals .')'); } $ SQL = "Insert into 'buyok _ produc' ($ cols) values $ vars "; Echo $ SQL; $ Aa = mysql_query ($ SQL, $ mysql_link ); If ($ aa ){ Echo "successfully "; } Else { Echo "failed "; } ?> |