mercredi 9 décembre 2015

Can i use queries inside mysqldump?

I have a Mysql database on my remote server with several tables. I need to get some of this tables with some of its rows using PHP to a local WPF program which uses SQLite.

The rows i need to get from each table depends of some different values for each table (i mean i must apply a different WHERE clause to every table), and i need to be able to use standar MySQL operations (like LEFT JOIN, UNION, etc).

So far, i am able to dump just 1 table with 1 WHERE clause:

exec('./mysql2sqlite.sh --databases test -u test -pTest --tables users --where "a="' . $a . '" AND b="' . $b . ' | sqlite3 db/file.sqlite');

I think what i need is to be able to execute several queries and then dump all the results inside the mysqldump, is it possible?

Also, is this the right approach to solve this kind of problem?

PD: I am using this MySQL2SQLite converter.

Aucun commentaire:

Enregistrer un commentaire