01-28-2008, 08:13 PM
|
#4 (permalink)
|
|
The Frequenter
Join Date: Nov 2007
Location: Netherlands
Posts: 445
Thanks: 49
|
The best thing you can do is simply (for this example) is to rip a MySQL SQL Dump from phpMyAdmin. It has all the characters you need to escape.
Every sentence that starts with '--' is an comment line, and every sentence that starts with a regular command like INSERT, UPDATE, TRUNCATE and ends with a ;, is a query.
To clarify, rtime removes all the whitespace behind each line. So if you (for human readability) want to use enters, that's fine. No problem there. Even TABs are fine.
For as far as I know, there is no way to perform multiple inserts without using a explode command to get rid of all the ... bullshit so to speak. The lines have to be cleaned first.
I tried my own using the foreach loop ($values as $value) or something like that and it worked. Aside of the last rule where it suddenly failed. But that's a bug in my script.
I'm guessing you want to use this for an installation?
Mark
edit,
Bill beat me to it lol, the mysqli way (as I just found out) is possible as well. You can then even import your file using file_get_contents();
Awesome way as well, I didn't know it was possible, after some research.
__________________
"Life is a bitch, take that bitch on a ride"
|
|
|