Getting rid null data output

i’m trying to output pictures from my upload table but there will be some rows where it will have a null ‘path’ and the output will be a question mark. how can i recode it so i’ll have the null ‘path’ not show up on the output?

$query = "SELECT stories.name, stories.entry, DATE_FORMAT(stories.date_entered, '%M %e, %Y %T') AS d, stories.title, upload.path 
FROM stories LEFT OUTER JOIN upload
ON stories.date_entered = upload.date_upload
ORDER BY date_entered DESC LIMIT $start, $display";
$result = @mysql_query($query);
$num = mysql_num_rows($result);

//Retrieve and print every record:
echo '<br/>';
while ($row = mysql_fetch_array($result)) {
echo '<div class="post"><h2 class="title"><a href="#">' .$row['title']. '</a></h2>';
echo '<p class="byline"><small>Posted on ' .$row['d']. ' by ' .$row['name']. '</small></p>';
echo '<img src="'.$row['path'].'"/>';
echo '<div class="entry"><p>' .$row['entry']. '</p></div>';
echo '</div>';

COALESCE(upload.path,‘’) AS path

this replaces the NULL with an empty string

you could also use any other default string, like ‘n/a’ or ‘missing’ or ‘no path’

and of course you’d want to suppress this – echo ‘<img src="’.$row[‘path’].‘"/>’;

thanks r937 for the reply. the coalesce() works perfect, but the question marks still appears because of echo ‘<img src="’.$row[‘path’].‘"/>’;
how can i suppress this so that only the ones with pictures in the db will appear and the one’s with empty strings won’t appear? will i have to make an if statement for this?

yeah, you’d use some kind of IF condition, but i can’t help you with that because i don’t do php

If it’s a regular array you can do:

if (!empty ($row['path']) )
{
     '<img src="'.$row['path'].'"/>'; 
}

awesome! thanks jream and r9 for your help!