Page 1 of 1

2 Orders in Query

Posted: Mon Mar 15, 2004 11:40 am
by John Cartwright
I've done this before but I'm sorta stumped on how to do it again.

Code: Select all

<?php
$result = @mysql_query("SELECT * FROM portfolio WHERE type='$section' ORDER BY `type`,`id` DESC"); 
?>
That gives parse error, HELP?
?????????????????

Re: 2 Orders in Query

Posted: Mon Mar 15, 2004 12:08 pm
by TheBentinel.com
Phenom wrote:I've done this before but I'm sorta stumped on how to do it again.

Code: Select all

<?php
$result = @mysql_query("SELECT * FROM portfolio WHERE type='$section' ORDER BY `type`,`id` DESC"); 
?>
That gives parse error, HELP?
?????????????????
I don't think you want quotes around the type and id:

Code: Select all

<?php
$result = @mysql_query("SELECT * FROM portfolio WHERE type='$section' ORDER BY type, id DESC"); 
?>
Does that help?