12-07-2007, 05:32 AM
|
#1 (permalink)
|
|
The Addict
Join Date: Nov 2007
Location: USA
Posts: 256
Thanks: 7
|
php within a query
I couldnt seem to figure this out on my own and google was not being my friend on this one.
Im trying to do a normal MySQL query but with a php if inside it. sounds simple enough ive done it in coldfusion multiple times just cant get the syntax for it in php. Example
PHP Code:
$result = mysql_query("
select *
from $dbName
//Next Line
Where if(isset($cat) { $cat = '1' }
order by updated DESC, time DESC
LIMIT $from, $max_results");
That Where clause is my problem. but i think i got the point across of what im needing.
|
|
|
|