hello all


i,m trying to open a file mydata.txt ans use the sql commands in it to delete, recreate and repopulate the tables in my db.

my code so far:

//File Open: Read
$myFile = "mydata.txt";
$fh = fopen($myFile, 'r');

//create an array to read the file
$array_of_lines=file("mydata.txt");

//count lines in a file
$numlines=count($array_of_lines);


//print count
print $numlines;


//this is to use mysql commands in the text file

foreach ($array_of_lines as $line) {
$line=preg_replace('/\n/','',$line);
$result=@mysql_query($line) || die;
}


is this ok?

if not any ideas

thanks