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 6638565
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T23:27:04+00:00 2026-05-25T23:27:04+00:00

I generated the below query for php using PHP-MYADMIN, My question is how to

  • 0

I generated the below query for php using PHP-MYADMIN,
My question is how to print the 30 rows it generates? when i use “see quote” it just errors out.

i am trying to echo the rows with search term and count in < div >< /div > tags each in its own.

  1. Facebook 38 searches
  2. Another Feed 25 searches
  3. Timeline 18 searches

and so on to row 30.


$result=mysql_query($sql)


$sql = 'SELECT COUNT(*) AS `Rows`, `search`, SUM(searched) FROM `af_timeline_search` GROUP BY `search` ORDER BY SUM(searched) DESC LIMIT 0, 30 ';

        /* top searches */
        $sqlthis = mysql_query('SELECT COUNT(*) AS `Rows`, `search` FROM `af_timeline_search` GROUP BY `search` ORDER BY `Rows` DESC');
        $num=mysql_num_rows($sqlthis);
        $arrS = mysql_fetch_array($sqlthis); 
        $i=0;
        while ($i < $num){
        echo 'Search '.$arrS[$i].'';
            $i++;
        }

Screen Shot of Query in PHPmyadmin.
enter image description here

  • 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-25T23:27:04+00:00Added an answer on May 25, 2026 at 11:27 pm

    I have found the solution to this. Thank you all for your guidance. 🙂 “you all rock”


    $sql = "SELECT COUNT(*) AS Rows, search, SUM(searched) FROM anotherfeed.af_timeline_search GROUP BY search ORDER BY SUM(searched) DESC";
    $result=mysql_query($sql) or die ('Error! yo.');
    $row = mysql_fetch_array($result);
                echo '<pre>';
                print_r($row);
                echo '</pre>';
    

            /* top searches with loop */
            $sql = "SELECT COUNT(*) AS Rows, search, SUM(searched) FROM anotherfeed.af_timeline_search GROUP BY search ORDER BY SUM(searched) DESC LIMIT 0, 20";
            $result=mysql_query($sql) or die ('Error! yo.');
            while($row = mysql_fetch_array($result))
              {
              echo '  (';
             echo urldecode($row['search']) . " " . $row['SUM(searched)'] . "";
             echo ')  ';
              }
    

    I am able to print the array, hopefully i can get the loop down with a while statement. Feel free to add a loop if you have or know one that is better… Thank You.

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

Sidebar

Related Questions

When I execute the code saveXML below it generates the error above, why?? using
I'm using graphviz (dot) to generate the graph you can see below. The node
I am currently exporting data from php to excel using the code as below:
I am exporting a SQL Server table to a CSV using php (see code
trying to instantiate a Query in SubSonic using the below method (as it apparently
Hi I am using a PHP Symfony project and am trying to use the
I'm making an ajax call using jQuery as below. $.ajax({ type: POST, url: proc.php,
Using the MySQL query below, I have created a pivot table which is pretty
How can I edit the code I use below to save the generated file
I'm using the PHP script below for an experiment I am conducting, however it

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.