I'm trying to create a script that will allow clients to export from a database and easily insert it into another - I've never done this so I'm not really sure exactly how this is done, but this is what I have...
$filename = "$file";
$fd = fopen ($filename, "rb");
$stuff = fread ($fd, filesize ($filename));
fclose ($fd);
$row = explode("\n",$stuff);
for($i=0; $i<sizeof($row); $i++)
{
$query .= "$row[$i]";
}
To be sure, I have printed out my array (using print_r) and it's fully loaded just like I want it.
The "file" has data that looks like this...
("INSERT INTO table VALUES (79, 'email@mail.com', 'Name', 'Last Name', '0', '1')");\n
If it were as simple as using phpMyAdmin this would be great, but it's not, the users are not allowed to touch it...I've dug through their file but that code is from another planet, I can't figure anything out in there...
Any ideas?....... . . ... . . v