Re: Conversion from access to mysql
| From: | Hatem Ben | Date: | Mon, 16 Sep 2002 07:15:45 +0000 |
| Subject: | Re: Conversion from access to mysql | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21769@lists.php.net to get a copy of this message | ||
Hey again,
if you haven't binary data in your database this script could help
you. If anyone can help for binary data this will be very helpfull for me
also ;-) I still have the same problem, but now using data in xml format.
<?php
// set_time_limit(3600);
// change with your own mysql code ;-)
require ("classes/mysql.class.php");
$connection = new mysql_db;
// Change the file name here
$backend ="detail.txt";
$i=1;
if(!($myFile=@fopen($backend,"r")))
{
$myFile= "A problem occured.";
}
while(!feof($myFile))
{
// Read each line and add to $myLine
$Line=fgets($myFile,255);
$values = explode("\t",$Line);
// print_r($values);
// echo "<br>";
if ($values[1]!==""){
// print_r($values);
$id = $values[0]; // first value
$name = $values[1]; if ($id!==""){$condition1=" where
name=$name";} //
second is the name
$address = $values[11]; if ($address
!==""){$condition2="address=$address";} // 11 is the address
$email = $values[3];if ($email !==""){$condition3=",
email=$email";} // 3
is the email
$connection->query("UPDATE member set $condition1$condition2$condition3
where id=$id"); // Mysql Query
unset($id,$name,$address,$email);
}
$i++;
}
fclose($myFile);
?>
Best Regards,
Hatem
----- Original Message -----
From: "Chris Grigor" <chris@calibre.co.za>
To: "'Dann Pedersen'" <Dann.Pedersen@tdcinternet.dk>
Cc: <php-db@lists.php.net>
Sent: Monday, September 16, 2002 8:15 AM
Subject: [PHP-DB] Conversion from access to mysql
>
> Howdi All
>
> I posted this last week, and some of you had some suggestions and none of
> them have worked....
>
> I have a database running on an Sql 2000 Server, I want to take this
> database and export it
> so that it can be used on a MySql Linux server running version 3.23
>
> I have tried exporting it to a text file, to an xls file and then using
> dbtools
>
> Anyone else have any good ideas this is the first time I am doing it...
>
> Cheers
>
> Chris
>
>
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php