Hi guys, i am creating a setup.php file so i can install my script on the fly on many different computers.
Anyways the 2 ways i think i can get this to work is to create a mysql_query(create table...) etc. But the problem with this is i will have to make a seperate query for every single insert, create statement which is quite sloppy.
The other way is to insert a query via a .sql file. This would be the best option but i cannot get it to work 🙁
Anyways this is what i have so far (does not work)
$fp = file($root_dir."/database.sql");
if(!$fp)
{
$error = "Could not open $root_dir/database.sql.<br>
Please ensure file is uploaded with correct permissions";
}
else {
for($i=0; $i<999; $i++);
{
echo $fp[$i];
echo mysql_error();
}
}
}
This does not work 🙁
Anyone know if this is possible? If not, are there any other alternatives?
Thanks alot 🙂