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 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2012
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool check table cell for data before using it



    Anyway to check a table cell to know if it has a value BEFORE posting it?
    e.g. A column has a list of images.
    one or more cells might be empty.
    when there is a block in the browser to display an image, and none is there, a place holder is indicated.
    I do not want the place holder to show in this case.

    PHP Code:
    if (isset($cov[0]))
     {echo 
    "<img src='http://mroldies.net/covers/$year/".$cov[0]."'>";} 
    This returns a place holder.

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,994
    Thanks
    4
    Thanked 2,662 Times in 2,631 Posts
    I'm not sure why this is in the mysql forum since there's no relation to SQL here. Moving to PHP forum.
    Perhaps its the empty construct you want, and not the isset construct. Make sure you use an else if you need to include a non-breaking space.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

  • #3
    Regular Coder
    Join Date
    Jun 2012
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts
    posted to mysql due to the fact I was asking about how to detect whether or not a particular data cell contained actual data.
    PHP is the language that is used to construct a working model of what is in a database.
    I will agree though that the post could be a php issue.
    Just a matter of personal interpretation of the problem.


  •  

    Posting Permissions

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