/    Sign up×
Community /Pin to ProfileBookmark

display in alphabetical

Hi

Is there anyway the below can be alterd to display films in alphabetical order

[CODE]$result = mysql_query(“SELECT * FROM `films` WHERE `TIMESTAMP` > DATE_SUB( NOW(), INTERVAL 7 DAY)”);

echo “<body bgcolor=”black” text=”red” link=”fuchsia” vlink=”purple” alink=”fuchsia”>n”;
echo ” <center>
<h1><b><font size=6 color=red>Last 7 Days</font></b></h1>
</center> <left>
<table border=’0′>
<hr></left>” ;

$i = 0;
while($row = mysql_fetch_array($result))
{
$i++;

echo “</br>”;
echo “<b><font size=5 color=fuchsia>{$row[‘Title’]}</font></b>”;
echo “</br>”;
echo “</br>”;
echo “<b><font color=red>Genre: </font></b><font color=fuchsia>{$row[‘Extras’]}</font>”;
echo “</br>”;
echo “</br>”;
echo “<b><font color=red>Plot: </font></b><font color=fuchsia>{$row[‘Info’]}</font></b>”;
echo “</br>”;
echo “</br>”;
echo “<a href=http://somewhere/filesarehere/{$row[‘Download’]}>Download</a>”;
echo ” – – “;
echo “<a target=’main’ href=’http://somewhere/filesarehere/{$row[‘View’]}’>View</a>”;
echo “</br>”;
echo “</br>”;
echo “<hr>”;
}
?>

[/CODE]

to post a comment
PHP

4 Comments(s)

Copy linkTweet thisAlerts:
@NogDogMay 17.2009 — Just add an ORDER BY clause to your query.
Copy linkTweet thisAlerts:
@FeckieauthorMay 17.2009 — Just add an ORDER BY clause to your query.[/QUOTE]

Yeh OK looked at that, now I am totally lost...ha ha
Copy linkTweet thisAlerts:
@NogDogMay 17.2009 — [code=php]
$result = mysql_query("SELECT * FROM films WHERE TIMESTAMP > DATE_SUB( NOW(), INTERVAL 7 DAY) ORDER BY xxxxxxxx");
[/code]

Where xxxxxx is changed to the name of the title column or whatever it is you want to sort by. ([B]ORDER BY xxxxx DESC[/B] if you want to sort in descending order)
Copy linkTweet thisAlerts:
@FeckieauthorMay 17.2009 — [code=php]
$result = mysql_query("SELECT * FROM films WHERE TIMESTAMP > DATE_SUB( NOW(), INTERVAL 7 DAY) ORDER BY xxxxxxxx");
[/code]

Where xxxxxx is changed to the name of the title column or whatever it is you want to sort by. ([B]ORDER BY xxxxx DESC[/B] if you want to sort in descending order)[/QUOTE]


Many Thanks
×

Success!

Help @Feckie spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...