Posts: 7,801
Threads: 187
Joined: Feb 2010
Reputation:
0
I know that in some MySQL scripts, the authors have made them so tables/fields are created automatically if they don't exist to begin with. I was thinking, rather than having the SQL code in the script, save it in a file. I am trying to use the basic file-functions to load the file, copy the information into a string, and execute the string's contents via MySQL. I am getting errors however.
Is this possible to do?
Posts: 2,896
Threads: 11
Joined: Sep 2008
Reputation:
0
Why would you need to do so in the first place? Why do you decide to execute them via a file rather than the script itself, as it'd just make it less efficient from having to parse the data from the file. The only advantage I can see is not having to re-compile the script every time you want to add a new line, but that takes mere seconds.
Either way, what errors are you receiving?
Posts: 2,896
Threads: 11
Joined: Sep 2008
Reputation:
0
There's nothing wrong with the SQL syntax inside the file, so something is screwing up when loading the data or calling it to the query. Please show that code.