- This topic is empty.
-
AuthorPosts
-
-
March 20, 2006 at 8:54 am #20920
peterlaursen
ParticipantQUOTE… into a php file that you could run from your php serverWhat you need is then to generate a PHP statment like
CODE$goforit = mysql_query('here goes 1st query') or die (mysql_error());$goforit = mysql_query('here goes 2st query') or die (mysql_error());
etc …
Now if you 'search and replace' the SQL generated by SQLyog in an editor and replace
CODE;with
CODE;') or die (mysql_error());$goforit = mysql_query('
it will be 95%. You will need to add the connection string and edit first and last statement. But it is a reasonably good idea of yours I think. One more export option: 'export as PHP-script'.
-
March 22, 2006 at 4:13 pm #20921
sloppyboy
MemberThanks for your reply. I think for now I'm going to write a script that parses through a directory of .sql files generated by SQLYog and throws each individual statement into an array to be executed on the db in the right order.
This way I'll be able to generate multiple .sql files from SQLYog, put them in a single directory, and the script will be able to pick them up in sequential order, parse through them, and apply all sql statements in the right order. This is going to be useful for dropping hotfix db schema updates for an application where you would have multiple .sql files based on bug fixes or schema changes in between application releases.
Tommy
-
March 22, 2006 at 5:54 pm #20922
Ritesh
MemberThis is a nice idea.
In the meantime, you can use my_strtok() function available in SQLyogTunnel.php for tokenising the queries.
-
-
AuthorPosts
- You must be logged in to reply to this topic.