MYSQL data in html table

MySQL related discussion or help, including phpMyAdmin.

MYSQL data in html table

Postby shanetlbrt » Sun Feb 07, 2010 5:23 pm

Hi, I'm having trouble getting this done, can someone help?
I have a table called albums in my DB, and I want to display it so that it displays the first 3 rows in a <tr>, and the next 3 in a new <tr> and so on and so...I know this involves a while and for loop and some extra variables, I just dont know how its done.
shanetlbrt
 
Posts: 70
Joined: Wed Jan 13, 2010 8:53 pm
Online: 7h 38m 26s
Karma: 0

Re: MYSQL data in html table

Advertisment

Advertisment
 

Re: MYSQL data in html table

Postby libeco » Sun Feb 07, 2010 5:27 pm

What exactly are you trying? A <tr> is a row, so I assume you mean three columns inside a <tr>? What data will you be storing in the table? If it's not tabular data you shouldn't use a table. In that case it's even easier as you can place each element in a div with a fixed width, which will automatically show on the next row once the current row is full.
Common PHP/MySQL errors | How to display code on the forum
"It always seems impossible until its done." - Nelson Mandela
User avatar
libeco
Moderator
 
Posts: 2466
Joined: Fri Apr 24, 2009 9:03 pm
Location: Netherlands
Online: 5d 9h 32m 31s
Karma: 25

Re: MYSQL data in html table

Postby shanetlbrt » Sun Feb 07, 2010 9:52 pm

It stores the album name and a picture. I dont really want to use DIV's because I have data above that already in a table, and I want it to "flow" along with this data.
shanetlbrt
 
Posts: 70
Joined: Wed Jan 13, 2010 8:53 pm
Online: 7h 38m 26s
Karma: 0

Re: MYSQL data in html table

Postby libeco » Mon Feb 08, 2010 5:13 pm

I understand tables are easier, but you really should be using divs as they are semantically correct elements for layout purposes. But like I said before, give more information.
Common PHP/MySQL errors | How to display code on the forum
"It always seems impossible until its done." - Nelson Mandela
User avatar
libeco
Moderator
 
Posts: 2466
Joined: Fri Apr 24, 2009 9:03 pm
Location: Netherlands
Online: 5d 9h 32m 31s
Karma: 25

Re: MYSQL data in html table

Postby wide_load » Mon Feb 08, 2010 9:12 pm

libeco wrote:I understand tables are easier, but you really should be using divs as they are semantically correct elements for layout purposes. But like I said before, give more information.


well. tables are alowed if they are used to display data in a table

just not for layout.
Image
User avatar
wide_load
Top Contributor
 
Posts: 5561
Joined: Thu Aug 13, 2009 1:04 pm
Online: 13d 14h 11m 30s
Karma: 45


Return to MySQL/phpMyAdmin

Who's online?

Users browsing this forum: No registered users and 1 guest