PHP Classes

what does this class do? just copy sql clauses?

Recommend this page to a friend!

      SQL Parser  >  All threads  >  what does this class do? just copy...  >  (Un) Subscribe thread alerts  
Subject:what does this class do? just copy...
Summary:Package rating comment
Messages:4
Author:Kevin Shu
Date:2011-10-26 16:20:37
Update:2011-10-31 14:55:38
 

Kevin Shu rated this package as follows:

Utility: Bad
Consistency: Bad
Examples: Not sure

  1. what does this class do? just copy...   Reply   Report abuse  
Picture of Kevin Shu Kevin Shu - 2011-10-26 16:20:37
what does this class do? just copy sql clauses?

  2. Re: what does this class do? just copy...   Reply   Report abuse  
Picture of Orazio Principe Orazio Principe - 2011-10-29 09:05:14 - In reply to message 1 from Kevin Shu
Exactly you can use it for example when you have a sql file that need to be executed for many database by php, you can retreive all queries with this class and you can execute them.
It's simple but usefull

  3. Re: what does this class do? just copy...   Reply   Report abuse  
Picture of Timo Henke Timo Henke - 2011-10-30 13:24:03 - In reply to message 2 from Orazio Principe
If you hava a VALID dump you could easily use, e.g. for mysql:

mysql -u'username -p'password -h'host' dbname < dumpfile ...

as a shellcommand / backtick ...

Also this way of "cutting out" the queries will blow up the memory of the script because it must hold all the queries in memory.

How about a 200-300MB SQL File? I've never seen any shared hosting company allowing such a size of memory for a single process.

  4. Re: what does this class do? just copy...   Reply   Report abuse  
Picture of Orazio Principe Orazio Principe - 2011-10-31 14:55:38 - In reply to message 3 from Timo Henke
Many times when you update a softare you have to execute customs queries vs. many differents databases.
With a sqldump you can execute and import a backup, but if you need to upgrade for example 100 databases stored into the same server for exaple to alter a table, update some values etc, with this script you can store a simple sql file and than use a php script to execute all queries for all databases.