Dharmender Posted May 28, 2013 Share Posted May 28, 2013 I need to upload SQL file and run it in controller in cakephp. I am unable to execute using exec and shell_exec both returns errors i.e. exec given empty string and shell_exec gives null value. How to run mysql command using exec or shell_exec Quote Link to comment https://forums.phpfreaks.com/topic/278467-cakephp-run-sql-file-in-controller/ Share on other sites More sharing options...
boompa Posted May 30, 2013 Share Posted May 30, 2013 What a horrible idea this is! Letting someone execute arbitrary SQL code against your database? Good gravy! Quote Link to comment https://forums.phpfreaks.com/topic/278467-cakephp-run-sql-file-in-controller/#findComment-1433273 Share on other sites More sharing options...
Jessica Posted May 30, 2013 Share Posted May 30, 2013 You can't execute an sql file, you can use the mysql commands to use loadfile. But yes, this is a horrible, horrible idea. Quote Link to comment https://forums.phpfreaks.com/topic/278467-cakephp-run-sql-file-in-controller/#findComment-1433274 Share on other sites More sharing options...
Dharmender Posted May 31, 2013 Author Share Posted May 31, 2013 My client wants to have backup and restore facility online. I have made online backup sql file. Now I want to allow user to upload sql file. You can't execute an sql file, you can use the mysql commands to use loadfile. But yes, this is a horrible, horrible idea. Quote Link to comment https://forums.phpfreaks.com/topic/278467-cakephp-run-sql-file-in-controller/#findComment-1433378 Share on other sites More sharing options...
DaveyK Posted May 31, 2013 Share Posted May 31, 2013 My client wants to have backup and restore facility online. So write code that allows him to without the security hazard ? Quote Link to comment https://forums.phpfreaks.com/topic/278467-cakephp-run-sql-file-in-controller/#findComment-1433384 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.