Re: Help With Inventory

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



# brandon@xxxxxxxxxx / 2007-01-22 22:55:50 -0800:
> "Jim Lucas" <lists@xxxxxxxxx> wrote in message 
> news:45B4E882.5050905@xxxxxxxxxxxx
> > $count = 0;
> > while ( $row = mysql_fetch_array( $invlist ) ) {
> >
> > if ( $count % 1 ) {
> > $rowColor = '#c1c1c1';
> > } else {
> > $rowColor = '';
> > }
> >
> > echo <<<HEREDOC
> >
> > <tr bgcolor="{$rowColor}">
> > <td class='body'>{$row['dvdId']</td>
> > <td>{$row['dvdTitle']}</td>
> > <td class='body'>{$row['dvdGenre']}</td>
> > <td>{$row['dvdGenre2']}</td>
> > <td class='body'>{$row['dvdGenre3']}</td>
> > <td>{$row['dvdActive']}</td>
> > <td class='body'>{$row['dvdOnHand']}</td>
> > <td>{$row['backordered']}</td>
> > <td class='body'>{$row['dvdHoldRequests']}</td>
> > <td>{$row['incomingInverntory']}</td>
> > <td class='body'>{$row['ogUserId']}</td>
> > <td>{$row['outDate']}</td>
> > <td class='body'>{$row['outUserId']}</td>
> > <td>{$row['inDate']}</td>
> > <td class='body'>{$row['inUserId']}</td>
> > <td>{$row['cycles']}</td>
> > </tr>
> >
> > HEREDOC;
> >
> > $count++;
> >
> > echo '</tbody></table>';
> > }
> > }
> >

> I don't understand how the quotient works there. I will sometime.
> I also don't understand the HEREDOC concept.
> 
> I wanted colors alternating to allow for a better read.
 
Ignore the heredoc thing, the "quotient" (remainder after division)
works just like it worked in your math class, but it should be

    if ( $count % 2 ) {
        $rowColor = '#c1c1c1';
    } else {
        $rowColor = '';
    }

Although I'd use

    $rowColors = array('', '#c1c1c1');
    ...
    $rowColor = $rowColors[$count % 2];

> I still have not solved the problem with listing the genre in its own row, 
> alone at the beginning of each section of genre (the start of each unique 
> genre which is the ORDER BY in the statement).
> 
> Thanks for the code. I need to learn how to write more eloquently like you.
> 
> If anyone can figure out the a row listing for the genres, that would be 
> soooo cool.

You want something like this?

genre  | #id | title         | #id | title         | #id | title
-------+-----+---------------+-----+---------------+-----+--------
horror | 123 | Scary Movie 1 | 456 | Scary Movie 2 | ... | ....
comedy | 234 | Funny Movie 1 | 456 | Funny Movie 2 | ... | ....


-- 
How many Vietnam vets does it take to screw in a light bulb?
You don't know, man.  You don't KNOW.
Cause you weren't THERE.             http://bash.org/?255991

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux