Jump to content

tensionx

New Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Everything posted by tensionx

  1. $result=mysql_query ("SELECT * FROM XXX"); when i throw a  { at the end It stops giving me that error. Then it sends me on my merry way to line 32. The last line... "</html>" and says Parse error: syntax error, unexpected $end in /home/wekillmo/public_html/tablemaker.php on line 32
  2. Well. Took out the extra { Now its saying [b]"Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/wekillmo/public_html/tablemaker.php on line 20" [/b] lol... my select is really simple select * from XXXX I just need a damn excel style table... $result=mysql_query ("SELECT * FROM XXX");
  3. I started doing PHP yesterday Excuse the syntax :) I come from ASP and am not tooo comfortable in this world yet.
  4. I broke this down and tested each section. Somehow i am missing something in the last line of my code. I could use some helping eyes. Here is my error [b]"Parse error: syntax error, unexpected $end in /home/wekillmo/public_html/tablemaker.php on line 37"[/b] [code] <html> <table border="0" CELLSPACING="0" CELLPADDING="10" align="center"> <?php //db connect and select $db = @mysql_connect("localhost", "XXX", "XXX"); if( ! ($db = @mysql_connect("localhost", "name", "password")) ) { } else { mysql_select_db("XXX",$db) or die("Select DB Error: ".mysql_error()); } $result=mysql_query ("SELECT * FROM XXX"); $count = 1; $column = 1; //loop statement while($myrow = mysql_fetch_array($result)) { { // first column display if ($column == 1) { //field is the column in your table printf("<tr><td>%s</td>",$myrow["name"]); } else{ //second column display    printf("<td>%s</td></tr>",$myrow["class"]); } $count += 1; $column = $count % 2; } ?> </table> </html> [/code]
  5. How many comments do you want to see per user? Do you want to see the last ten? SELECT top 10,* from (table) WHERE blah blah What exactly do you want to see?
  6. [table] [tr][td]<b>Name</b>[/td][/tr][/table] Bob Steve Mark Sara John [/table] 7 columns the primary key is the userid Sorts tied to the primary key. Side by side like an excel spreadsheet hehe
  7. 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.php Its very dissapointing. lol I 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.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.