richclever
IS-IT--Management
Hi,
I have a mysql dump file that I need to get php to process.
Anybody know how?
Thanks
Richard
I have a mysql dump file that I need to get php to process.
Anybody know how?
Thanks
Richard
Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
<?php
$handle = fopen("/tmp/mysqldump.sql", "r");
while (!feof($handle)) {
$buffer = fgets($handle, 4096);
# processing code here
}
fclose($handle);
?>
it doesn't want to take the data on the lines with the CR/LF on them.
while (!feof($handle)) {
# another while here that checks out if the line contains
# );
$buffer = '';
while(!strstr($buffer,');') && !feof($handle)){
$buffer.= fgets($handle, 4096);
}
$queryelement="$buffer";
$result = mysql_query ($queryelement);
$count++;
};