Im using php exec() to import an uploaded sql file.
$cmd = "mysql -h localhost -u forum_user --password=1234 import_forum < C:\Users\Josh\AppData\Local\Temp\import-1452620686.sql"
exec($cmd, $output, $worked);
return $worked;
The problem is, its not actually executing anything because nothing is imported to the database. However, if I copy and paste this command into the terminal, it imports just fine.
This seems to be an issue locally on my windows machine because the script works fine in our linux environment.
Also, the $worked variable is returning as 1, which should mean that the command is executed without a problem. But that is not the case.
Is this some kind of a permissions issue? What am I missing?
Edit 1
The mysql path is set and working properly.
Edit 2
Actual path is C:\Users\Josh\AppData\Local\Temp\import-1452620686.sql
Edit 3
$output is an empty array
\tis the tab escape sequence for example, so I'm guessing your Windows path separators are not being escaped.C:\\Users\\path\\to\\file.sql