Results 1 to 5 of 5
  1. #1
    ABW Ambassador Doug247's Avatar
    Join Date
    January 18th, 2005
    Location
    DE USA
    Posts
    931
    Can someone give me an example of how to take records retrieved from a mySQL database and lay out the information in a table layout. Say 3 columns x 4 rows. I know how to get the records and display them one row at a time.


    Thanks,

    DOug

    Bye!

  2. #2
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    <pre class="ip-ubbcode-code-pre">&lt;table&gt;
    &lt;?php while ($user = db_fetch_assoc($result)) { ?&gt;
    &lt;tr&gt;
    &lt;td&gt;
    &lt;?php echo $user['name']; ?&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;?php echo $user['email']; ?&gt;
    &lt;/td&gt;
    &lt;td&gt;
    &lt;?php echo $user['phone']; ?&gt;
    &lt;/td&gt;
    &lt;tr&gt;
    &lt;?php } ?&gt;
    &lt;/table&gt;</pre>

    If you only want four rows use a "LIMIT offset, rows" clause in your database query.
    Lead, Follow or Get Out of the Way!

  3. #3
    ABW Ambassador Jane's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,350
    But you are putting 4 different items in each column. If you put all your code for one product in a table in dreamweaver and then do a repeat region so all products are included, it goes straight down the page. How do you make this display in grid format?

  4. #4
    Just Lurking
    Join Date
    January 18th, 2005
    Posts
    1,263
    <BLOCKQUOTE class="ip-ubbcode-quote"><font size="-1">quote:</font><HR>Originally posted by jane:
    But you are putting 4 different items in each column. If you put all your code for one product in a table in dreamweaver and then do a repeat region so all products are included, it goes straight down the page. How do you make this display in grid format? <HR></BLOCKQUOTE>Ha? I don't use Dreamweaver much anymore, so I have no idea. Grid format? Maybe:<pre class="ip-ubbcode-code-pre">&lt;table border="1"&gt;</pre> It's a table that basically a grid if you don't start throwing in rowspan and/or colspan.
    Lead, Follow or Get Out of the Way!

  5. #5
    ABW Ambassador Jane's Avatar
    Join Date
    January 18th, 2005
    Posts
    1,350
    Well didnt mean to throw you with my lousy terminology. By grid I just meant a table with rows and columns. So it called a grid in cgi or somewhere..

  6. Newsletter Signup

+ Reply to Thread

Similar Threads

  1. FOA Todd
    By Gordon in forum Commission Junction - CJ
    Replies: 15
    Last Post: March 1st, 2004, 07:42 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •