I have 3 .sql files I am attempting to run via .php for a database administration panel of sorts.
- create_database.sql //to create the database, tables, and attributes
- insert_company_values.sql //inserts populate one portion of the database
- insert_student_values.sql //inserts to popluate another portion of the database
I have tried several operators in PHPs, and most any syntax I can think of, and made SOME headway with the following:
$exec = shell_exec("C:\\mysql\\bin\\mysql --username=user --password=pass < C:\\Inetpub\\wwwroot\\database\\create_database.sql") or die("did not work");
This "appears" to work, as the function does not die or throw an error, but when I go back into mysql, the database has not been created.
If I echo the $exec, the output is what I noticed at the top of winmysqladmin and her is a basic excerpt (it is quite long):
Ver 11.18 Distrib 3.23.54, for Win95/Win98 (i32) Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB This software comes with ABSOLUTELY NO WARRANTY. This is free software, and you are welcome to modify and redistribute it under the GPL license Usage: C:\mysql\bin\mysql [OPTIONS] [database] -?, --help Display this help and exit. -A, --no-auto-rehash ...... select_limit current value: 1000 max_join_size current value: 1000000
If any more information is needed, but these are the current results.
Note: Safe mode is NOT enabled for PHP.
Thanks kindly for your time and attention.