php text database-need to add input records


#1

[php]

restaurant database


<? $filename = "data3.txt"; if(!($myfile = fopen($filename, "a"))) { print("error: "); print("'$filename' could not be created\n"); exit; } // write some lines to the file

fputs($myfile, “olive garden
\n”);

//code for inputing records to file, gathered from
//
//
//code for inputing records to file, gathered from

//close the file
fclose($myfile);
if(!($myfile = fopen($filename, “r”)))
{
print(“error:”);
print("’$filename’ could not be read\n");
print(“next line\n”);
exit;
}
while(!feof($myfile))
{
//read a line from the file
$myline = fgets($myfile, 255);

//print("$myline
\n");
print("$myline \n");
}
//close the file
fclose($myfile);
?>

[/php]

#2

What is your problem all you have posted is code?