Current location: Hot Scripts Forums » Programming Languages » PHP » Don't show.


Don't show.

Reply
  #1 (permalink)  
Old 01-13-09, 09:31 AM
SniperTowers SniperTowers is offline
Wannabe Coder
 
Join Date: Dec 2008
Posts: 143
Thanks: 5
Thanked 0 Times in 0 Posts
Arrow Don't show.

I have this:
PHP Code:

function listoffers($cat){
    
$uid $_SESSION['id'];
    if(
$cat == "none"){
    
$result mysql_query("SELECT * from offers ORDER BY `title` ASC");    
    }else{
    
$result mysql_query("SELECT * from offers WHERE categoryID='$cat'");
    }

    while(
$list mysql_fetch_array$result )){
        echo 
"<img align=\"left\" src=\"images/";
        echo 
$list['image'];
        echo 
"\" width=\"120px\" height=\"60px\">";
        echo 
"<b><a href=\"";
        echo 
$list['link'];
        echo 
"\">";
        echo 
$list['title'];
        echo 
"</a> | £";
        echo 
$list['value'];
        echo 
" | ";
    echo 
$list['value2'];
                echo 
"%</b><br/>"
        echo 
$list['description'];


        echo 
" <br/><b><a style=\"float: right\" href=\"completed.php?offer=";
        echo 
$list['id'];
        echo 
"&user=";
        echo 
$uid;
        echo 
"\">Completed</a></b><br/><br/>";  
}} 
How would I fix it so if ['value'] equals 0.00 don't show and show ['value2'] instead, and if ['value2'] equals 0 don't show and show ['value'] instead.

Thanks.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 01-13-09, 09:55 AM
UnrealEd's Avatar
UnrealEd UnrealEd is offline
Community Liaison
 
Join Date: May 2005
Location: Antwerp, Belgium
Posts: 3,165
Thanks: 4
Thanked 25 Times in 25 Posts
use an if...

edit: or better, use the max function
__________________
"Good judgement comes from experience, and experience comes from bad judgement." - Fred Brooks

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to link a buttom to a script (show div) in another page?? marianne fawzi JavaScript 3 01-08-09 10:53 AM
Toggle button and show next Rapid Dr3am JavaScript 4 03-28-08 12:17 PM
Just cant get it to show all dirs size presso PHP 6 03-19-07 05:54 PM


All times are GMT -5. The time now is 06:18 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.