Afficher un message
Vieux 29/10/2007, 23h31   #4
Mauroreggio@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut 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.

  Réponse avec citation
 
Page generated in 0,04363 seconds with 9 queries