tensionx Posted August 1, 2006 Share Posted August 1, 2006 I am trying to build my DKP tracking tool. I have my beta up right now. My biggest conundrum is displaying my MySql table in an organized fashion with sort functions. my current out put is:[code]$sql = "SELECT * FROM UFDKP";$result = mysql_query($sql);if ($myrow = mysql_fetch_array($result)) {do{$USERID=$myrow["USERID"];$Name=$myrow["Name"];$Class=$myrow["Class"];$SWR=$myrow["SWR"];$RP=$myrow["RP"];$Tier1=$myrow["Tier1"];$Tier2=$myrow["Tier2"];$Tier3=$myrow["Tier3"];echo "<BR>USERID: $USERID"; echo "<BR>NAME: $Name"; echo "<BR>CLASS: $Class"; echo "<BR>SWR: $SWR"; echo "<BR>RP: $RP"; echo "<BR>TIER 1: $Tier1"; echo "<BR>TIER 2: $Tier2"; echo "<BR>TIER 3: $Tier3"; }while ($myrow = mysql_fetch_array($result));}?>[/code]http://wekillmonsters.com/show.phpIts very dissapointing. lolI tried a table Function[code]function GenerateTable($sqlResult, $Headers) { $row = mysql_fetch_assoc($sqlResult); $FieldList = Array_Keys($row); echo "<table Border=2>"; Echo "<tr>"; For ($Cnt=0; $Cnt < Count($FieldList); $Cnt++) { echo "<th>" . $Headers[$FieldList[$Cnt]] . "</th>"; } echo "</tr>"; While ($row) { $RowColor = ($RowCnt % 2) ? "row1":"row2"; Echo "<tr>"; For ($Cnt=0; $Cnt < Count($FieldList); $Cnt++) { echo "<td class='$RowColor'>" . $row[$FieldList[$Cnt]] . "</td>"; } echo "</tr>"; $RowCnt++ ; $row = mysql_fetch_assoc($sqlResult); } echo "</table>"; } [/code]I could not get it working. I am a beginner at this. The only thing I am confident in is my queries because thats my work. If someone could point me in the write direction so I can figure out how to bring these 2 things together It would be much appreciated.Thanks. Quote Link to comment Share on other sites More sharing options...
redarrow Posted August 1, 2006 Share Posted August 1, 2006 Can you kindly tell me what look you want outputted cheers. Quote Link to comment Share on other sites More sharing options...
tensionx Posted August 1, 2006 Author Share Posted August 1, 2006 [table][tr][td]<b>Name</b>[/td][/tr][/table]BobSteveMarkSaraJohn[/table]7 columnsthe primary key is the useridSorts tied to the primary key.Side by side like an excel spreadsheet hehe Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.