i create form to load sql file and used fopen function top open file and read this but when want to execute this data to database not work? what is wrong in my code?????????????
$ofile = trim(basename($_FILES['sqlfile']['name']));
$path = "sqlfiles/".$ofile;
//$data = settype($data,"string");
$file = "";
$connect = mysql_connect('localhost','root','');
$selectdb = mysql_select_db('files');
if(isset($_POST['submit']))
{
if(!move_uploaded_file($_FILES['sqlfile']['tmp_name'],"sqlfiles/".$ofile))
{
$path = "";
}
$file = fopen("sqlfiles/".$ofile,"r") or exit("error open file!");
while (!feof($file))
{
$data = fgetc($file);
settype($data,"string");
$rslt = mysql_query($data);
print $data;
}
fclose($file);
}