Skip to main content

PHP scroll question 88 Responses

Last post: 2 years, 2 months ago | Thread started: Mar 11, 10, 9:29 a.m.

RespondNew TopicDisable Images

  • Claymantis

    on my products.php page I have...

    <div id="scroll_links">
    <?php
    mysql_select_db($db_dbase, $connect);
    $result = mysql_query("SELECT * FROM products WHERE `cat` = '$catid' ORDER BY `name` ASC");

    if (mysql_num_rows($result) > 3) {
    ?>
    <a href="#" class="click_up_by_134" title="Click to scroll"><img src="images/products_up.gif" alt="up" /></a>
    <a href="#" class="click_down_by_134" title="Click to scroll"><img src="images/products_down.gif" alt="up" /></a>
    <?php
    } else {
    ?>
    <div id="scrolldeaden"></div>
    <?php
    }
    ?>
    </div>

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earMar 11, 10, 9:40 a.m. – Permalink
  • Claymantis

    on my products.php page I have...

    <div id="scroll_links">
    <?php
    mysql_select_db($db_dbase, $connect);
    $result = mysql_query("SELECT * FROM products WHERE `cat` = '$catid' ORDER BY `name` ASC");

    if (mysql_num_rows($result) > 3) {
    ?>
    <a href="#" class="click_up_by_134" title="Click to scroll"><img src="images/products_up.gif" alt="up" /></a>
    <a href="#" class="click_down_by_134" title="Click to scroll"><img src="images/products_down.gif" alt="up" /></a>
    <?php
    } else {
    ?>
    <div id="scrolldeaden"></div>
    <?php
    }
    ?>
    </div>

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earMar 11, 10, 9:40 a.m. – Permalink
  • Claymantis

    Sorry for the double post.

    It says my scroll img are there?

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earMar 11, 10, 9:41 a.m. – Permalink
  • Claymantis

    I'm not sure what you mean - when you say I didnt output my scroll buttons?

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earMar 11, 10, 9:44 a.m. – Permalink
  • acescence

    for whatever reason mysql_num_rows($result) is not greater than 3 and the else clause is being executed

    + add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earMar 11, 10, 9:44 a.m. – Permalink
  • vaxorcist

    It seems to just work the way it's supposed to.... did you get a strange client call that caused you to wonder if all is well?

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earMar 11, 10, 2:26 p.m. – Permalink
  • nikdaum

    In both examples, the list is scrolling to only show one extra product. I know down the line there may be more there, but if there are only that many, couldn't the spacing between them be reconfigured so no scrolling was necessary to begin with?

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earMar 11, 10, 7:02 p.m. – Permalink

Login or Register to respond to this

Skip to main content