Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: db var chage

  1. #1
    New to the CF scene
    Join Date
    Feb 2006
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    db var chage

    I have a script pulling data from mysql db. I have a date field that automatically inserts 0000-00-00 by default. So my code goes

    if ($row['trained'] == "0000-00-00") {
    $row['trained'] ="<img src='/track/images/icon_x.gif'>";
    } else {
    $row['trained'] ="<img src='/track/images/icon_check.gif'>";
    }

    If the date in the db is 0000-00-00 then it will display icon_x.gif if it has any other date it will display icon_check.gif.

    I want to know how i can make it show the image like it is and display the alt text with the date on the icon_check.gif

    Thanks,
    Brian

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    else { 
    $row['trained'] ='<img src="/track/images/icon_check.gif" alt="' $row['trained'] .'">'
    Is this what you want?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •