grozanc Posted April 4, 2009 Share Posted April 4, 2009 Hello All, I'm working on a web site that needs to list all the rows in a table. This is how I have been doing it. # $query = "SELECT link, page_title, page_content, path FROM $table WHERE approved ORDER BY page_title ASC"; # $result = mysql_query($query) or die('Error, query failed'); # if (mysql_num_rows($result) > 0 ) { # while(list($link, $page_title, $page_content, $path ) = mysql_fetch_array($result)) # $string .= "<a href=".$link." class=maplinkrev target=_blank>".$page_title."</a><br>".nl2br($row['page_content'])."<br><br>"; # } # echo "$string"; This works fine. However, not every entry will always have a link and I need to figure out how to use an if statement to display the link only when it's in the table row but still display the page title. I have no idea of where to begin to look to find the answer to this! Any help would be appreciated. Regards, Gary Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.