Sorting by number
Moderator: General Moderators
Sorting by number
If I wanted to sortby a number, not just the number 1, but all the numbers, how would I do that? action=sortby&char=num ? action=sortby&char=number? action=sortby&char=1,2,3,4,5,6,7,8,9,0?
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
heres my code, basicly I can sort it by various letters, but numbes, but not just the ones that begin with 1 but all the numbers,
Code: Select all
if($_GETї'action'] == 'sortby')
{
$result = mysql_query("select * FROM interdb WHERE bandname LIKE '".strtoupper($_GETї'char'])."%' ORDER BY bandname ASC LIMIT 5",$db);
while($myrow = mysql_fetch_array($result))
{
echo ( "<p><b><a href=?action=view&id=" .$myrowїid]. " class=link>" . $myrowї'bandname'] . "</a></b> <font class=rm>- " . date("F j", strtotime($myrowї'date'])) . "</font>" );
echo ( "<br>" . $myrowї'preinter'] );
echo ( "<br><b><font class=rm><a href=?action=view&id=" .$myrowїid]. " class=rm>...Read More</a></b></font>" );
}
}
elseif($_GETї'action'] == 'view')
{
$result = mysql_query("SELECT * FROM interdb WHERE id=$id",$db);
$myrow = mysql_fetch_array($result);
{
echo( "<br><b>" . $myrowї'bandname'] . " Interview</b>" );
echo( "<p>" . $myrowї'preinter'] );
echo( "<p>" . $myrowї'inter'] );
}
}
else
{
$result = mysql_query("SELECT * FROM interdb ORDER BY id desc LIMIT 5",$db);
while($myrow = mysql_fetch_array($result))
{
echo( "<p><b><a href=?action=view&id=" .$myrowїid]. " class=link>" . $myrowї'bandname'] . "</a></b> <font class=rm>- " . date("F j", strtotime($myrowї'date'])) . "</font>" );
echo( "<br>" . $myrowї'preinter'] );
echo( "<br><b><font class=rm><a href=?action=view&id=" .$myrowїid]. " class=rm>...Read More</a></b></font>" );
}
}