Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,231
    Plugin Contributions
    22

    Default Basic query question with MoveNext

    This is so basic I hate to even ask but I can't see what I've done wrong.

    I know the query is correct because I used it in the database so I'm missing something in the MoveNext function. It must not be as simple I want it to be.

    Instead of the 4 different buttons, it gives the same button 4 times

    Code:
    <ul class="ceebox mixed">
    <? 
      $buttons = $db->Execute("select * from " . TABLE_CATEGORY_BUTTONS . " where cat_id = '" . zen_get_products_category_id((int)$_GET['products_id']). "' ");
    	  $buttonName =  $buttons->fields['name'];
          $url =  $buttons->fields['url'];
    while (!$buttons->EOF) { ?>
    					<li><a href="/shop/popups/<?php echo $url   ?>">
    					<img width="159" height="34" border="0" src="shop/images/category_buttons/<?php echo $buttonName   ?>" /></a></li>
                        </ul>
                        <?php $buttons->MoveNext();
                        }
                        ?>
    The full-time Zen Cart Guru. WizTech4ZC.com

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Basic query question with MoveNext

    You have set $buttonName and $url before the while loop, so they will not change no matter what button is current.

    Also, you want the </ul> after the end of the while loop.

  3. #3
    Join Date
    May 2006
    Location
    Gardiner, Maine
    Posts
    2,231
    Plugin Contributions
    22

    Default Re: Basic query question with MoveNext

    Boy, I'm glad your brain is working today because mine sure isn't! LOL

    Thanks for the quick answer so I can finish this thing.
    The full-time Zen Cart Guru. WizTech4ZC.com

 

 

Similar Threads

  1. v154 Help with a SQL Query for Query Builder
    By lindasdd in forum Managing Customers and Orders
    Replies: 2
    Last Post: 24 Mar 2016, 01:18 PM
  2. Replies: 4
    Last Post: 17 Oct 2013, 10:55 PM
  3. Basic Query
    By KiwiBrian in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Jul 2008, 01:50 PM
  4. Basic Question
    By iDartsOnline in forum Setting Up Categories, Products, Attributes
    Replies: 1
    Last Post: 21 Jun 2008, 07:42 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR