0
I have a . mdb file, and I need to inject all of its data into Mysql using PHP code. What I do is the following:
// Executa comando via shell para upload do banco no mysql
$scriptEsquema = shell_exec('mdb-schema uploads/arquivo.mdb mysql | grep -v ^DROP | mysql -u usuario meubancodedados');
$scriptInsert = shell_exec('mdb-export -D "%Y-%m-%d %H:%M:%S" -H -I mysql uploads/arquivo.mdb MINHATABELA | mysql -u usuario meubancodedados');
- On my computer works smoothly, but when passing to a server it no longer works.
Is there another way to do this with PHP? Or something I should do on the server?
puts the whole path in your line, if it’s linux
/var/www/html/teu-projeto/uploads/arquivo.mdb
and if it’s windowsc:\um\lugar\uploads\arquivo.mdb
, I believe bash runs without identifying where your directory is when it’s done the way you specified it. or simply puts it in the codecd/caminho/uploads/arquivo.mdb && mdb-schema ...
– William Novak