Outputting a table from MySql database, Suggestions |
![]() ![]() |
Outputting a table from MySql database, Suggestions |
May 29 2007, 12:26 AM
Post
#1
|
|
|
Member ![]() ![]() Posts: 50 OS: XP |
I have set up a MySql table with 15 cols of various data. Each row then represents a single transaction. There would be up to 25 rows max. The first col will be no's from 0-up to 25, but there may only be eg. 4 rows in the table at the time when they're viewed. I've tried to create code with loops to retrieve line by line to output to a page with a table built into it. It goes into never-ending loops and I cant seem to find a way to retrieve 'as many' lines are there. I'm sure there is a simple-ish way to do this, but I cant find a working example to study. Any ideas? ? ? |
|
|
May 29 2007, 10:41 AM
Post
#2
|
|
|
- i pwn n00bs - Posts: 1,258 From: Phila. PA OS: openSuse, Ubuntu, Fedora, Debian |
How are you accessing the data in the mysql database.
I am going to assume that you are using php. This will give you a place to start. http://www.thescripts.com/serversidescript...ases/index.html |
|
|
May 31 2007, 06:28 AM
Post
#3
|
|
|
Retired Staff Posts: 1,856 From: Australia OS: Linux |
I normally do something like this, it is a bit different that that shown in ditto's link
CODE $result = mysql_query("SELECT col FROM table") or die(mysql_error());
while($row = mysql_fetch_array($result)) { $col = $row['col']; //do something with $col } |
|
|
Jun 8 2007, 10:42 AM
Post
#4
|
|
|
Member ![]() ![]() Posts: 50 OS: XP |
Thanks for that Guys - I have it sorted now.
|
|
|
![]() ![]() |
Similar Topics
| Topic Title | Replies / Views | Topic Information | |||||
|---|---|---|---|---|---|---|---|
![]() |
1 / 952 | 18th August 2006 - 11:52 PM TomPainter started - last by dsm |
|||||
![]() |
9 / 368 | 2nd February 2007 - 11:54 PM Wren182 started - last by Michael |
|||||
![]() |
3 / 236 | 20th June 2007 - 06:01 AM TheWern started - last by Michael |
|||||
![]() |
1 / 748 | 26th May 2008 - 08:57 PM Diego8 started - last by Diego8 |
|||||
|
Time is now: 5th December 2008 - 04:51 AM |
| Advertisements do not imply our endorsement of that product or service. The forum is run by volunteers who donate their time and expertise. We make every attempt to ensure that the help and advice posted is accurate and will not cause harm to your computer. However, we do not guarantee that they are accurate and they are to be used at your own risk. |