Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    May 2003
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Okay i screwed something up....

    Code:
    <?PHP
    
    mysql_connect("localhost", "XXXX", "XXXX") or die(mysql_error());
    mysql_select_db("XXX") or die(mysql_error());
    
    $query = "SELECT tdate,company,priority,wfmcase,escstatus,description FROM submissions WHERE ostatus ='Open'";
    
    
    $result = mysql_query($query) or die(mysql_error());
    ?>
    <table width="700" border="1">
      <tr>
        <td colspan="6">Open Cases</td>
      </tr>
      <tr>
        <td class="table-title">Date</td>
        <td class="table-title">Company</td>
        <td class="table-title">Priority</td>
        <td class="table-title">Status</td>
        <td class="table-title">Case</td>
        <td class="table-title">Description</td>
      </tr>
    <?php
    while($row = mysql_fetch_array($result)){
    echo "<tr><td>" . $row['tdate'] . "</td>
        <td>" . $row['company'] . "</td>
        <td>" . $row['priority'] . "</td>
        <td>" . $row['escstatus'] . "</td>
        <td>" . $row['wfmcase'] . "</td>
        <td>" . $row['description'] . "</td>
      </tr>";
    }
    ?>
    <tr>
        <td colspan="6">Seperator</td>
      </tr>
      <tr>
        <td colspan="6">Closed Cases</td>
      </tr>
    <?php
    $query2 = "SELECT tdate,company,priority,wfmcase,escstatus,description FROM submissions WHERE ostatus ='Closed'";
    $result2 = mysql_query($query2) or die(mysql_error());
    while($row2 = mysql_fetch_array($result2)){
    echo "<tr><td>" . $row['tdate'] . "</td>
        <td>" . $row['company'] . "</td>
        <td>" . $row['priority'] . "</td>
        <td>" . $row['wfmcase'] . "</td>
        <td>" . $row['escstatus'] . "</td>
        <td>" . $row['description'] . "</td>
      </tr>";
    }
    ?>
      <tr>
        <td colspan="6">Footer</td>
      </tr>
    </table>
    
    </body>
    </html>
    Okay heres the deal, the first query works fine, and returns the results that are "Open" however the 2nd query does not return any results that are closed. There are closed results i have verified them at the mysql console...... why wont they display? what did i do wrong?

  • #2
    New Coder
    Join Date
    May 2003
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    HA, im an idiot its confirmed...

    Maybe i should learn to read what i write better. I found my spelling mistake. On the second query it should have been $row2[''] in the echo command and i had just $row['']

    :doofus:

  • #3
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,280
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Please read our posting guidelines section 2:

    http://www.codingforums.com/postguide.htm

    before creating any more threads. Your subject does not fit within the parameters of our guidelines.
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #4
    New Coder
    Join Date
    May 2003
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    my apologies...

    and noted


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •