Re: [PHP] Best way to duplicate tables to another DB using PHP

2001-10-03 Thread David Yee

mysqldump would work pretty well if the source DB is mysql, but it's a DB I have to 
access via ODBC on a windows box instead.  And this particular DB doesn't seem to have 
a command line interface to export a table that I can call from PHP.  

David
  - Original Message - 
  From: sagar N Chand 
  To: David Yee 
  Sent: Wednesday, October 03, 2001 6:09 AM
  Subject: Re: [PHP] Best way to duplicate tables to another DB using PHP


  use mysql statement mysql_dump thru php.

  /sagar

- Original Message - 
From: David Yee 
To: [EMAIL PROTECTED] 
Sent: Wednesday, October 03, 2001 2:52 AM
Subject: [PHP] Best way to duplicate tables to another DB using PHP


Hi guys.  What do you suggest is the best (fastest, most efficient) way to
duplicate a table from one database to another using PHP?  I have a windows
machine setup with ODBC for this old school DB (Pervasive SQL 7) and I would
like to duplicate some of the tables into a Linux box with MySQL for some
datawarehousing purposes.  The largest table is about 30K records.  I'm not
sure if something like a select * and then doing a foreach record insert
into MySQL would be the best way.  Thanks for any suggestions.

David


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



Re: [PHP] Best way to duplicate tables to another DB using PHP

2001-10-03 Thread David Yee

Nope- nothing useful yet anyways :-).  I guess maybe the only thing to do is
to select different ranges for the table (if it's too big) instead of a
select with no where clause.  Now to think of it I guess you can even select
one record at a time sequentially if the pk is integer based.  Then you can
do something like:

for ($i=0; i++; i$num_rows_in_table){
 $q=select * from my_table where id = $i;
 $result=odbc_exec($connect, $q);
 etc. (e.g. insert into the target mysql DB/table)
}

David

- Original Message -
From: Joseph Koenig [EMAIL PROTECTED]
To: David Yee [EMAIL PROTECTED]
Sent: Wednesday, October 03, 2001 6:47 AM
Subject: Re: [PHP] Best way to duplicate tables to another DB using PHP


 David,

 Did you get any responses on this post? I'm actually looking at a very
 similiar situation and thinking the exact same thing. I've done a
 select * and then a while loop before to accomplish this, but with dbs
 where the largest table was about 1K rows. Big difference. Please let me
 know if you get any responses or find anything out. Thanks,

 Joe

 David Yee wrote:
 
  Hi guys.  What do you suggest is the best (fastest, most efficient) way
to
  duplicate a table from one database to another using PHP?  I have a
windows
  machine setup with ODBC for this old school DB (Pervasive SQL 7) and I
would
  like to duplicate some of the tables into a Linux box with MySQL for
some
  datawarehousing purposes.  The largest table is about 30K records.  I'm
not
  sure if something like a select * and then doing a foreach record
insert
  into MySQL would be the best way.  Thanks for any suggestions.
 
  David
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] Best way to duplicate tables to another DB using PHP

2001-10-02 Thread David Yee

Hi guys.  What do you suggest is the best (fastest, most efficient) way to
duplicate a table from one database to another using PHP?  I have a windows
machine setup with ODBC for this old school DB (Pervasive SQL 7) and I would
like to duplicate some of the tables into a Linux box with MySQL for some
datawarehousing purposes.  The largest table is about 30K records.  I'm not
sure if something like a select * and then doing a foreach record insert
into MySQL would be the best way.  Thanks for any suggestions.

David


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]