Jump to content

Welcome to Geeks to Go - Register now for FREE

Geeks To Go is a helpful hub, where thousands of volunteer geeks quickly serve friendly answers and support. Check out the forums and get free advice from the experts. Register now to gain access to all of our features, it's FREE and only takes one minute. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, post status updates, manage your profile and so much more.

Create Account How it Works
Photo

Basic output from MySQL table to a Web Page


  • Please log in to reply

#1
TheWern

TheWern

    Member

  • Member
  • PipPip
  • 81 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