For Programmers: Free Programming Magazines  


Home > Archive > PHP SQL > August 2004 > Where to insert the 'Order By' clause in this query









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Where to insert the 'Order By' clause in this query
Daniel Hesselink

2004-08-29, 8:55 pm

Hi,

Got the following statement but I need to order results by the 'Title'
column.
How to do that within the current fragment?

<?
$pos=0;
while($rec=mysql_fetch_assoc($result))
{
$r=mysql_query("SELECT * FROM `$tbl_prs` WHERE `ID`='".$rec['PRID']."'");
$record=mysql_fetch_assoc($r);
?>

Regards,
Daniel


J.O. Aho

2004-08-30, 3:56 am

Daniel Hesselink wrote:
> Hi,
>
> Got the following statement but I need to order results by the 'Title'
> column.
> How to do that within the current fragment?
>
> <?
> $pos=0;
> while($rec=mysql_fetch_assoc($result))
> {
> $r=mysql_query("SELECT * FROM `$tbl_prs` WHERE `ID`='".$rec['PRID']."'");
> $record=mysql_fetch_assoc($r);
> ?>
>
> Regards,
> Daniel
>
>


Set it last in your querry.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com