Jump to content

Welcome to Geeks to Go - Register now for FREE

Need help with your computer or device? Want to learn new tech skills? You're in the right place!
Geeks to Go is a friendly community of tech experts who can solve any problem you have. Just create a free account and post your question. Our volunteers will reply quickly and guide you through the steps. Don't let tech troubles stop you. Join Geeks to Go now and get the support you need!

How it Works Create Account
Photo

Basic output from MySQL table to a Web Page


  • Please log in to reply

#1
TheWern

TheWern

    Member

  • Member
  • PipPip
  • 82 posts
Hi,
This is a bit of a follow up from an earlier question. I have managed to writePHP code to draw my info line by line from the MySql database. My test script output the print in one long stream of info - but at least I know its doing what its supposed to as far as the retrieval is concerned.
What I want to do now is print this info neatly. There are about 15 columns and up to 25 rows. Some of the columns MAY have info or may be blank. There may be one row or up to 25 rows, with a total row below that.

Should I be creating a table (inside a layer) for the out put or printing one long line and then the next line......
I cant work out how to print a line at a time to fill a table that will vary in row size.

Any pointers or sample code I can scrutinise? ? ? ?

Cheers,

Sandy
  • 0

Advertisements


#2
BirdieUK

BirdieUK

    Member

  • Member
  • PipPip
  • 33 posts
Vary in row size?

If you dont want a row or something, you could 'theoritically' just do something like..

<?
if($row[field] != "")
{
echo "<td>$row[field]</td";
}

  • 0

#3
BirdieUK

BirdieUK

    Member

  • Member
  • PipPip
  • 33 posts
Sorry.

Edited by BirdieUK, 19 June 2007 - 08:39 AM.

  • 0

#4
Michael

Michael

    Retired Staff

  • Retired Staff
  • 1,869 posts
Showing us what code you have so far might help us show you how to change it.
  • 0






Similar Topics

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

As Featured On:

Microsoft Yahoo BBC MSN PC Magazine Washington Post HP