Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7183151
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:55:18+00:00 2026-05-28T17:55:18+00:00

I’m creating a new website, I don’t want to link direct to it so

  • 0

I’m creating a new website, I don’t want to link direct to it so I’ll put spaces inbetween:
test . glow – sticks . org
I have a list of the 15 most popular products on the right hand side of the page (WHATS HOT), I would like to show a number for each one, the first being 1 and the last being 15.

I am a php noob, but despite reading about using range and foreach at the php manual site, I’m struggling to show numbers. I’ve found it easy to show the same range of numbers for each product block, e.g 1,2,3…15 showing 15 times, but this obviously isn’t what I’m trying to do.

I probably need to give more info than I have here, so I’ll past the code that I’m working with on the php include:

<div id="whatshot_smallblock">
<a href='/<?=str_replace(" ","-",$productname)?>.html'><img src='http://www.glow-sticks.org/images/products/<?=$productimage?>' alt='<?=$productname?>' width='66' height='66' hspace="2" vspace="2" border='0' class="radius" />
</a>
<div id="whatshot_smallblock_Txt">  
<a href='/<?=str_replace(" ","-",$productname)?>.html'><?=$productname?></a><br><div id="pink_color"><span class="content_2"><?=$minprice_dis?></span><?=$_SESSION['currsymbol']?><?=$minprice?></div></div>
<div id="bigblacknumbers"></div></div>

and in my objectmanager php file I can see the code relating to the whatshot section:

//what's hot
function whatshotids() {
    if( !isset( $this->dblink ) )
    dbconnect();

    //$sql = "SELECT COUNT(pid) AS repetitions, pid FROM gs_orderlines GROUP BY pid ORDER BY repetitions DESC LIMIT 15";
    $timenow = time();
    $checktime = ($timenow - 1814400); // 3 weeks
    $sql = "SELECT COUNT(pid) AS repetitions, gs_orderlines.pid FROM gs_orderlines INNER JOIN gs_orders ON gs_orders.oid =
            gs_orderlines.oid WHERE gs_orders.datetime >= $checktime GROUP BY gs_orderlines.pid ORDER BY repetitions DESC LIMIT 15";

    $result = mysql_query( $sql, $this->dblink )
    or die( "Invalid query Line 1018" );
    $i = 0;
    $whids = array();
    while( $row = mysql_fetch_object( $result ) ) {
        ////
        $sql2 = "SELECT * from gs_inventory WHERE pid = ".$row->pid. " AND display_product='1' AND stock>0 AND canbackstock!='yes'";
        $result2 = mysql_query( $sql2, $this->dblink ); 
        if($row2 = mysql_fetch_object( $result2 )){ 
            $whids[$row->pid] = $row->repetitions;
            $i = $i + 1;
        }
    ...
    }
...
}

Hopefully this is enough or too much information.

Many thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:55:19+00:00Added an answer on May 28, 2026 at 5:55 pm

    It seemed that the only thing I needed to do was to enter:

    <?$counter++; echo $counter;?>
    

    And it just started counting from the first iteration.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I want to show the soap response to UIWebview.. my soap response is, <p><img
I don't have much knowledge about the IPv6 protocol, so sorry if the question
I want to construct a data frame in an Rcpp function, but when I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.