I've a string with a huge mySQL query, seperated by a semi-colon and then line-break. You can't run this query staright to mySQL (and i dont want to try), so Im trying to split up the query into, say, 100 mysql commands at a time.
Is it possible to split up a string every 100 semi-colons it finds??
I input this string from a text file through fopen while(fgets)? Is it easier to just read 100 lines at a time, run a query, and then read another 100 lines from the text file?
Maybe you should be using the LOAD_FILE() function in your query?
Quote:
LOAD_FILE(file_name)
Reads the file and returns the file contents as a string. The file must be on the server, you must specify the full pathname to the file, and you must have the FILE privilege. The file must be readable by all and be smaller than max_allowed_packet. If the file doesn't exist or can't be read due to one of the above reasons, the function returns NULL:
mysql> UPDATE tbl_name SET blob_column=LOAD_FILE("/tmp/picture") WHERE id=1;
-- ---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/
PHP|Architect: A magazine for PHP Professionals – www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php