Jump to content


Using PHP to display records in multi column format


2 replies to this topic

#1 pairodimes

    Young Padawan

  • Members
  • Pip
  • 3 posts

Posted 28 September 2006 - 10:44 PM

I need some help - any advice on how to use php to display mysql records in a multi column layout.

Basically I need something simple - like:


a table with 3 columns, and however many rows (devided by 3) are in the Mysql database.

Do you know of any good tutorials or code to make something simple like this happen?

I have seen a tutorial on how to build a small photogallery, but it was way too much. I just need to display my record set in 3 columns, but I don't know how to tell Php to start a new row after ever 3 records... :biggrin:


Many thanks in advance.

#2 Trix06

    Young Padawan

  • Members
  • Pip
  • 292 posts
  • Gender:Male
  • Location:NSW Australia
  • Interests:Web Design & Development, Graphic Design, Programming, Networking, Girls, The Beach, Amatuer Radio Communications and more.

Posted 29 September 2006 - 12:43 AM

I think it would be somthing like this:

$output .= "<tr>";
$output .= "<td>" . $row['name'] . "</td>";
$output .= "<td>" . $row['phone'] . "</td>";
$output .= "<td>" . $row['address'] . "</td>";
$output .= "</tr>";
$output = $output . "</table>";

Maybe someone could explain it better lol :biggrin:

#3 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 29 September 2006 - 03:01 PM

This question has been asked before, please use the forum search.
http://www.pixel2lif...showtopic=16127





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users