Jump to content


Photo

Displaying data from a database?


  • Please log in to reply
1 reply to this topic

#1 cturner

cturner
  • Members
  • PipPipPip
  • Advanced Member
  • 148 posts
  • LocationMy computer

Posted 30 October 2006 - 02:44 AM

Can someone please tell me how I can display the data that has information in it from a database? Only the rows and columns that have data in it. For instance if I have bullets in a database table I only want to display the bullets that have information not having bullets continuing down a page. Thanks in advance.

#2 sanfly

sanfly
  • Members
  • PipPipPip
  • Advanced Member
  • 344 posts
  • LocationNew Zealand

Posted 30 October 2006 - 04:07 AM

you could use empty() to determine if there any data, then only echo the rows where there is data included

if(!empty($row['my_data']){
  echo $row['my_data'];
}
else{
  // do nothing
}
If you're not part of the solution, you're part of the precipitate




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users