I'm a beginner to php. I've been working on this script for a few days and here's what I'm wanting it to do. I have a mySQL database set-up with three columns fileName, description, and date, all with their appropriate data types. I use these columns as a instrument for my navigation to pull out the articles as described by my fileName based on the date they were published. The php script I have now is working fine, BUT I would like to implement in the script a link back to the main article listing page. Right now, my articles are in a sub-folder under my root directory, and my main article listing page in my root directory. So I need a way to bring the code on that one fileName up one level in my site's structure. Here's the code that I'm speaking of:
PHP:
<?php
//start the table
echo "<table>";
// run the query
$query = mysql_query("SELECT * FROM articles ORDER BY articleDate;");
$index=mysql_query("SELECT fileName FROM articles WHERE fileName='index.php';");
//loop through the result array and display rows
while($result = mysql_fetch_array($query))
{
$date = $result['articleDate'];
$file = $result['fileName'];
$description=$result['description'];
echo"<tr><td>",$articledate,"</td><td><a href=\"",$file,"\">",$description,"</a></td></tr>\n";
}
?>
Any suggestions would be appreciated
Ryan