Welcome Guest, Not a member yet? Register   Sign In
Execute multiple query all together
#1

[eluser]ReSTe[/eluser]
Hi, i have a problem trying to make the restore of my db.
I load from a text file the backup istructions saved. I write the content into a string then i do : $this->db->query($data); but CI tell me that i have a syntax error between the first query and the second one.
How can i do? Is this kind of execution possible?
Thanks
#2

[eluser]gtech[/eluser]
Hello, I am assuming you have a sql backup file with lots of sql statements in it. I don't think you can run a block of queries through $this->db->query($data), it only does one sql statement at a time.

you may have to call a system command to load your backup file in mysql (assuming thats your database). [url="http://particletree.com/notebook/backing-up-a-mysql-database-with-php/"](Click here for an example)[/url] it looks quite straight forward to do.. not sure on the implications of doing it like this though, worth a try. Note you can retrieve most of the parameters from the database config.




Theme © iAndrew 2016 - Forum software by © MyBB