I hope that subject made sense, read on as I don't believe this is a clear cut variable passing question.
I have a site where I have created a cute little news script.
I have it displaying my news in ASC or DESC dependant on how I poll the database.
What I WANT to do is allow the viewer to decide whether or not to see the oldest or newest first.
In my file news_archives.php I have this menu on the left:
Code: Select all
<a href="/news_archives.php?direction=ASC">Date Ascending</a><br>
<a href="/news_archives.php?direction=DESC">Date Descending</a><br>The page loads, all is good...
NOW, In my script where the looping occurs that draws the news items from the database I have these lines:
Code: Select all
$travel = "$direction";
$content = mysql_db_query($dbname, "SELECT * FROM newscontent ORDER BY id $travel");It doesn't though, it always seems to show it DESC.
Can anyone offer some help as to how I can pass that string to the MYSQL query?
Most thanks...
Rob