Howdy,
I have rewritten the sqlImport function. It now parses the file and then
sends the information to the proper core function.
The allows those functions to take care of sequencing and table prefixing.
I have tested it using prefixing and without.
I have only written the CREATE (as in table, never database) and INSERT
portions.
One note: I created a function named newCreateTAble. It is different from
sqlCreateTable in that you pass just an indexed array, not an associative
array. What this allows is that you just enter the text for the columns,
one per row. That way you do not have to plug the index and primary key
information into the array.
Example
$array["id"] = "int NOT NULL, primary key (id)";
$array["name"] = "varchar(20) NOT NULL default ''";
$array["config"] = "text NOT NULL";
sqlCreateTable ("table_name", $array);
Otherway
$array[] = "id int NOT NULL";
$array[] = "primary key (id)";
$array[] = "name varchar(20) NOT NULL default ''";
$array[] = "config text NOT NULL";
newCreateTable ("table_name", $array);
This made it easier for the sqlImport function to parse the file and,
IMHO, is just an easier format. I really would prefer not have to extract
the name of the column from each definition.
So we can keep both or settle on one. Speak up on the pros and cons of
either.
I'll be working on the other importable (word?) SQL functions next.
Matthew McNaney
Internet Systems Architect
Electronic Student Services
Email: ma...@tu...
URL: http://phpwebsite.appstate.edu
Phone: 828-262-6493
ICQ: 141057403
|