Re: Copy data from MsSql database to a MySql database in batch mode. > I think this may have been better asked at alt.php.sql.
>
> $mysql="DELETE FROM table";
> mysql_query($mysql);
>
> $mssql="SELECT * FROM table";
> $msres=mssql_query($mssql);
> while($row=mssql_fetch_row($msres)) {
> $mysql="INSERT INTO table VALUES('{$row[0]}','{$row[1]}',...)";
> mysql_query($mysql);
>
> }
>
> I do suggest you would make the following changes to the code:
>
> 1. Make a backup of the table in mysql before you delete all rows from it.
> 2. In the php code, make error checks and return both query and error, if
> there would be some kind of error
>
> --
>
> //Aho
It Works.
Thanks Aho.
Bye. |