Jump to content

Jessica

Staff Alumni
  • Posts

    8,968
  • Joined

  • Last visited

  • Days Won

    41

Posts posted by Jessica

  1. It shouldn't work in any browser, there's nothing to actually put the stripes on the rows.

     

    A. That should be a while loop, not a do-while.

    B. You should have a variable to hold the number of rows, then alternate the class based on that. Here's a simple example:

    <?php
    $num = 0;
    while ($row_recordset1 = mysql_fetch_assoc($recordset1)){
        $num++;
        $class = $num%2 ? 'even' : 'odd';
        echo '<tr class="'.$class.'">';
        echo '<td>Row Data Here</td>';
        echo '</tr>';
    }
    ?>

    Edit: I see the JavaScript now that was supposed to do it. I strongly recommend using PHP instead, unless you dynamically alter the table with JS later. Your JS isn't working because you're putting the tableClass class on a span, not the table row. So .tableClass tr never exists.

  2. If there was an actual error with the query, you'd get an error. You may have a LOGIC error with it. Put the query into a string, echo it out, and try running it directly in MySQL or phpMyAdmin. See what is returned.

     

    This part:

    WHERE MONTHNAME(Events.Event_Date) = MONTHNAME('".$_POST["Month"]."') And YEAR(Now())

    Makes no sense to me.

  3. I omitted the functions / properties to keep the example simple but I do have a basic User class. It just made sense to me that seen as a RegisteredUser has all the properties of an UnregisteredUser that the RegisteredUser should extend from that class.

     

    The point being made is that you should not have 3 user classes. You need 1. You don't need RegisteredUser and UnregisteredUser.

     

     

     

    I could get around it doing the checks you have suggested but I can't believe there is nothing native in PHP that says "are you an instance of this particular class?".

    There is.

×
×
  • 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.