Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy. This forum is not for asking programming related questions.
Hey guys and gals,
Article.php?ID=5 accesses the mySQL DB, determines the filename of the text file that ID 5 corresponds to(i.e. Election2008.txt), and then will output it. I don't want to it to go directly to the .txt file because then it won't be formatted. Here is my PHP:
<?
...query code not important...
$file_to_output = mysql_result($result,0,"location");
echo
"<html> <!--formatting codes--!>
[b]Right here is where I want the text to be placed from the textfile $file_to_output[/b]
</html>
";
close();
?>
arborint wrote:Check the PHP manual for a MySQL example. You need to fetch the row after your query, then include the file using a value in the row.
Thanks, but as you can see from the above code I already know that. I do not understand the how to output it, i.e. grab the text from the textfile and printing it. There's physically a textfile on the server, I need to know how to get the contents of which.