开发者

PHP adodb dump from one table to another

开发者 https://www.devze.com 2023-02-01 06:56 出处:网络
I\'ve got a PHP development environment using PostgreSQL and a hosting environment using MySQL.I\'m using adodb as an abstraction layer for easy migration between the two.

I've got a PHP development environment using PostgreSQL and a hosting environment using MySQL. I'm using adodb as an abstraction layer for easy migration between the two.

I'd like to dump the MySQL table(s) and restore them in PGSQL, and vice versa. In PGSQL I would use pg_dump and pg_restore to ac开发者_开发技巧complish this, but that won't be applicable for a MySQL table.

Does adodb offer some command to dump or backup a table in a different format? Like

$dbConnection -> Dump('mytable','pgsqlFormat');

or something?

If not, any suggestions are of course welcomed. Thanks in advance.


Will end up exporting and importing CSV files to solve this problem.

A note to future adodb users who stumble across this question:

I thought when I started that AdoDB was the only option for a database abstraction layer. Turns out the PDO extension in PHP does the same thing (and more), natively, and with better support.

I've switched to PDO now. Didn't know there was a (better IMO) option to adodb :) Hope that saves someone some time.


Why not use MySQL's mysqldump command and then import into PostgreSQL with psql -f?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号