Execute mySql script from within php script

mesmo

New member
Joined
Oct 19, 2007
Messages
1
Hello people. Heres my problem:
i need to create a database if it doesnt exist, or do some insertions if it does exist. I dont know the db structure beforehand or the data to insert; i get them from a dbDump, so i have to set up a php script that calls mysql < sqlFiles . . .
Please dont tell me to use something else. I have to launch the mysql scripts from a php script. I ve tried evrything from backticks to popen and it simply wont work, the best output i have being a hang on the web page;
but when i take my string to the CLI, it goes smoothly, that is
cmd> mysql -u root < c:\sqlScript.sql
it works fine
:( help me save my job . . .:(
am on a win2000 server using wamp5 1.7.2, that is:
Apache 2.2.4
PHP 5.2.3
5.0.41-community-nt
Please, help me
 
You're in the wrong place. This forum is for users of DirectAdmin, a hosting control panel which runs with Linux and FreeBSD.

Jeff
 
Back
Top