$dbQuery="SELECT * FROM sale";
$result = mysql_query($dbQuery,$db);
while ($macInfo=mysql_fetch_array($result))
{
$productID=$macInfo["productID"];
$name=$macInfo["name"];
$dateBought=$macInfo["dateBought"];
$numBought=$macInfo["numBought"];
$out=fopen("fileCreateYourself.txt","a") or die ("file won't open");
fwrite($out,"Product ID = $productID Name = $name Date Bought = $dateBought Num Of This Prod To Date = $numBought\n");
}
fclose($out);
This is my code to let me write to a txt file, but to do so I have to change my permissions within the database to chmod 777, is there any way I can include this command in the code, and the permissions just change every time I run this file???
Cheers