How do I hide the display of empty dynamic fields in a PHP query

I need help, I've spent the whole day on this, and I'm not getting any further.
I am creating a simple blog, where articles can be added via a form in dreamweaver that uploads data to a mysql database.
I have the following fields in the database:
"title", "text", "image" "link" (and datestamp)
The text, image and link fields can be left blank, so I have set their attribute to NULL, i.e. can be NULL
to display this data, I have created a page and added a recordset that reads as follows:
SELECT niklas.`date`, niklas.title, niklas.text, niklas.image, niklas.link
FROM niklas
the problem is some of the articles will only have text, some will have text and image, some only image.
When I view the page, it shows me the images that are there, but when there is no image in that particular record, the page shows a blue question mark instead.
What i want to do, is show only what is not null
I cannot use the WHERE command, as this completley omits an entire record, if the one field is empty.
Another problem I have is the link, as these are added through the form, and then stored in the mysql database, how do I display them dynamically so that they are active links to external web pages?
I'm very new to this, and rather a slow learner, so simple help is really needed!
please please help!! I'm really struggling and have deadlines fast approaching!
Thank you in advance!
xxx

Determine the condition of the data where it's displayed on the page using if/else. Here's an example for the thumbnail:
<?php
// Show IF thumbnail is NULL
if ($row_profile['thumbnail'] == "") {
?>
<img src="image_not_found.gif" alt="No Profile Image Available">
<?php
// else show the thumbnail
} else { ?>
<img src="<?php echo $row_profile['thumbnail']; ?>" alt="<?php echo $row_profile['thumbnail']; ?>">
<?php }
// end if thumbnail is present
?>
Do the same technique for any area that may or may not have data.
Create a dynamic link like this:
<a href="<?php echo $row_profile['website']; ?>"><?php echo $row_profile['thumbnail']; ?></a>

Similar Messages

  • How can I hide the number of unread eMails on my mail-symbol in my dock?

    Hello,
    I don't want to be disturbed while I am working so I am trying to hide the number of unread mails in my dock-symbol. I remember, that - some years ago - I could switch my preferences to not show any mails in my dock, but with the new Lion, I can just select wether I want to show all the unread mails or just the unread mails listet in my inbox.
    Any suggestions, how I can hide the number of unread eMail in my dock?
    Thanks a lot in advance
    Eike

    If you go to Settings>Notification Centre>Mail each of your email accounts will appear here separately. You can then change if Badges are displaye on the Mail App - which will show you the number of emails - or not.
    Regards,
    Steve

  • How do I hide the "US" and the "$" sign in a Cell formatted as Currency?

    I do not need to show that the neumbers in a cell are "US Dollars" so how do I hide the two symbopls "US $"?

    If you don't want any currency symbol (there are many to choose from) to display in front of your number, choose the Number format instead of Currency in the right panel (which you get to by clicking the Format brush (upper right).
    SG

  • How do you hide the identity from others

    How do I hide the wireless identity from others?  I am using airport + time capsule.

    I think you may be referring to the option to "close" your wireless network. If you enable this option, the theory is that other users around you will not "see" the name of your wireless network.
    But, this "feature" is long out of date. There are dozens of free utilities on the Internet that will display your network name in seconds. All the neighborhood teenagers who are looking for free Internet already have the applications.
    On the other hand, it might help keep a few honest neighbors from seeing the name of your wireless network if that would be important to you.

  • How can I change the display of Inbox in my iPad's mail app- so that it takes up the full screen?

    How can I change the display of Inbox in my iPad's mail app- so that it takes up the whole screen, as opposed to just about one third; the other two thirds display the full text of the selected email?

    You can't change the display in the Mail app, if you are holding the iPad in landscape orientation then the left-hand third will be for navigation, and the right-hand two-thirds will be an email. If you hold the iPad in portrait orientation then the navigation section becomes a drop-down section.

  • How can I hide the class file ??

    Hi !
    I has a question, when i write a program of Java, then use the command "javac" to compiler to class file for other people using, but the class file can be disassembled and convert to source code. How can I hide the class file and let people can not disassemble, or can not see the source code. Thinks

    See these....
    http://www.saffeine.com/
    http://www.jarsafe.com/
    I recently read this. This will help you.
    http://developer.java.sun.com/developer/qow/archive/160/index.jsp
    Enojy....
    Rajesh

  • How do i change the display in ADE to a single page view instead of two pages side by side? I find it distracting and prefer to look at one page at a time.

    How do i change the display in ADE to a single page view instead of two pages side by side? I find it distracting and prefer to look at one page at a time.

    You can increase the font size and automatically page view changes. Go to menubar; Reading -> PDF View or Epub Text Size (depending upon the ebook) and increase the size.

  • How do I hide the artist picture in ios 7 music player?

    I like the artist and album "list view" in the ios 6 music player much better than the view that includes a random picture on ios 7.  How do I hide the picture and get my list view back?

    Just to clarify the behavior I'm experiencing on my iPhone 5, I can get new updates but the old ones appear with the Open button and don't clear themselves out from the Update screen.

  • How can i hide the menu bar at the bottom of the app in itunes

    how can I hid the bar at the bottom of the App screen in itunes. Where it shows how much audio, app etc space you have left on your device

    Unforrtunately the status bar doesn't make any difference, however I have worked out that the bar does show when I go into full screen. 
    I would have thought it should also work when not in full screen - it certianly used to.

  • How can I hide the password and user name in url???

    Hi experts,
    I'm creating a login page and know I have a problem.
    The Username and password are verified in a Java class, after checking the user and password, the user should be linked to the portal.
    So far everything has worked well.
    But when I call the lin like this
    res.sendRedirect ("/ irj / portal j_user =" + UserN + "& j_password =" + passw);
    then the user name and Pwasswort appears in the url.
    Can someone tell me how can I hide the password and user name???
    It will be very helpful.
    Thank you
    Edited by: Cilvaring on Aug 5, 2011 12:00 PM

    If there is no specific reason that you have to use sendredirect...thne you can try request.forward.....
    RequestDispatcher rd = request.getRequestDispatcher("pathToResource");
      rd.forward(request, response);

  • How can I hide the borders and keep it as an option?

    How can I hide the borders and keep it as an option?  I had someone go into the css I believe, and make it so there were no borders visible on the page (I could see the dotted outline while working on it, but when pushed, it wasn't visible (which is what I wanted).  They called it "noborders."  Since I had to reinstall, it went away.  Help?
    I have Dreamweaver CS5.5

    Try this site:  CSS Border
    Add code then type in a zero. Later add border size you want.
    examples:  border: 0px solid black;
    or
    border: 1px 000000;
    or
         border-top-style: solid; 0px 000000;
         border-right-style: dotted; 0px 000000;
         border-bottom-style: solid; 2px 000000;
         border-left-style: dashed; 1px 000000;

  • My iPod is showing a white screen. I could not see anything. But I can listen to songs by blindly pressing the play button twice. The battery comes only for an hour.? How do I get the display and longer battery?

    Hello Friends,
    I've two iPod Nanos (4th gen - 8GB). I'm facing a severe problem with both of them. For both iPods, I tried to do this method Simultaneously press the top button + home (central) button. But of no use.
    1. My first iPod is showing a white screen. I could not see anything. But I can listen to songs by blindly pressing the play button twice. The battery comes only for an hour.? How do I get the display and longer battery?
    2. My second iPod is facing more severe problem. None of the buttons are working. When I connect it my PC it showing "CONNECTED- eject before disconnecting". But it is not ejecting with all the usual methods. When I manually and physically disconnect it from the PC the same "CONNECTED- eject before disconnecting" is still showing till the battery goes off. After that if i press any button it is showing low battery signal. And when i re-connect it to the PC the same process is repeating. When I tied to restore it to the factory settings I'm getting "Error" report.
    (I'm using windows 7)
    Friends, Please help me with the above problems. It will be a great help.
    Thank You.
    R.SAMALA

    Sounds like some hardware issues, meaning you'll want to take or send the iPods in for service or repairs. You can choose to have Apple do an out of warranty exchange for the prices indicated in the link below or find another third party service perhaps even local to your area.
    http://www.apple.com/support/ipod/service/prices/
    B-rock

  • How do I hide the background when I shape an image in 3D?

    This is a problem that has cropped up before but I'm going to simulate it.
    Say in this instance I want to overlay the picture of a kitten over a ball image. I've already extracted (roughly) the background from the kitten picture. I want to use 3D to warp it to the shape of a sphere but I've still got the ball's default background colour as well. How do I hide the background colour of the ball entirely so only the, warped, image of the kitten is visible to overlay over the ball image?
         When I wrap the kitten image onto a 3D sphere mesh preset I get the default background
         And when I try to overlay it over the 2D ball image the background prevents correct overlaying. I want just the kitten pic
    Thanks

    You apply the texture to the transparency of the material.
    Mylenium

  • How do I change the display order in the VPN menu in the status bar?

    Hello,
    How do I change the display order in the VPN menu in the status bar?
    (in the drop-down menu from this icon) ->
    Thanks.

    Hello. Perhaps this is because you are trying to arrange the order of many VPN services, since only one VPN service can be selected at once in System Preferences. In my original post, I did not mean that; I meant that I wanted to arrange the order of VPN configurations within a VPN service. In this screenshot, I have one VPN service only:
    And in the following one, it is shown that there are more than one VPN configurations within that VPN service:
    Furthermore, it was the order of VPN configurations that I wanted to change, not the order of VPN services. If you are trying to change the order of VPN services, I do not have a solution.

  • How I can hide the iCloud music library in iTunes?

    How I can hide the iCloud music library in iTunes? I want to see only my local music library.

    If you go into edit and click preferences there is a checkbox in the "store" tab that says "Show iTunes in the Cloud purchases" if you uncheck that it will show only the local content.

Maybe you are looking for