|
|||||||
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Member (10 bit)
|
populating an html table from a mysql database
Hi guys,
I'm cuurently in the process of making a few modifications on my car website which is running on Vbulletin, I'm working on making a 1/4 mile time's chart that show's the username, car make & model (these are extracted from the user's profile -- that bit works). Basically the idea is that the user just enters a time and it add's / updates their entry in a MySQL database i've made, that bit is sort of working. My main question here is how can i retrieve the entire contents of the database and display it into a table with three columns, the databsae has only one table called "quartermile" and 4 fields "ID" which is the primary key (auto-incremented), "username" varchar field that contains the username they use on the forum, "car" varchar field which combines their make & model of car and finally "qttime" decimal which contains their quarter mile time to 2 decimal places. I just cant seem to get my head round how to retreieve the entire contents of that database table into an HTML table. Any advice would be greatly appreciated (already googled this problem for 2 hours with no good info found) ![]() EDIT - I should mention that the site/my scripts are done in php and the output is actually XHTML (i think) as i'm outputting directly into a vbulletin template using variables Thanks
__________________
Intel Core i7 920 2.66GHz | Asus P6T SE| 6GB Corsair ram | XFX Radeon HD 4780 | 2 x 250 Gb Maxtor SATA II (in RAID 0), 1 x 250GB SATA II | Creative XFI soundcard | Coolermaster 650W PSU | ThermalTake Tsunami case My new website -Carp Fishing Forums Last edited by Designer; 08-06-2005 at 03:07 AM. |
|
|
|
|
|
#2 |
|
Member (10 bit)
|
don't know if this will be any help to anyone in providing me with an answer but here's the code i've got for the template and for the PHP script.
PHP Code:
HTML Code:
$stylevar[htmldoctype] <html dir="$stylevar[textdirection]" lang="$stylevar[languagecode]"> <head> <title>$vboptions[bbtitle]</title> $headinclude </head> <body> $header $navbar <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center"> <tr> <td class="tcat">Quarter mile table :)</td> </tr> <tr> <td class="alt1">Some text goes here to describe what my quarter mile table is all about</td> </tr> </table> </br> </br> <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="1" width="100%" align="center"> <tr> <th><font face="Arial, Helvetica, sans-serif">Username</font></th> <th><font face="Arial, Helvetica, sans-serif">Car</font></th> <th><font face="Arial, Helvetica, sans-serif">Quarter-Mile Time</font></th> </tr> <if $currentrow !== $lastrow> <tr> <td><font face="Arial, Helvetica, sans-serif">$user</font></td> <td><font face="Arial, Helvetica, sans-serif">$car</font></td> <td><font face="Arial, Helvetica, sans-serif">$qttime</font></td> </tr> </table> </br> </br> Add/Amend my time <div> <form action="evaluatetest.php" method="get"> <input type="text" class="bginput" name="quartertime" /></div> </br> <input type="submit" class="button" value="Submit / Amend" /> </form> </br> $footer </body> </html> Thanks Last edited by Designer; 08-06-2005 at 09:08 AM. |
|
|
|
|
|
#3 |
|
Member (10 bit)
|
Resolved this, just made new template called $mybits
made repeadted calls to it from the php script |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|