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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:48:07+00:00 2026-06-09T05:48:07+00:00

I run this query directly in phpmyadmin , it perfectly returns result !! but

  • 0

I run this query directly in phpmyadmin , it perfectly returns result !!
but when I run this query in my php script , it returns NULL

this is my db class:

class Product extends Places_Db_Table_Row_Observable  {
    protected $_name = 'product';
    PUBLIC function getMaxSubcatProduct()
    {


        $query = $this->getAdapter()->query("select  max( c ) AS maxcount,id from ( select COUNT(*) as c 
                    ,product_sub_category_id as id  from product group by product_sub_category_id ) as max ");
        $res = $query->fetchAll();
        return $res;
    }
}
  • 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-06-09T05:48:08+00:00Added an answer on June 9, 2026 at 5:48 am

    this was my fault! I showed the result in my script like this :

    echo $this->masterMenu["id"];
    

    but correct way is:

    foreach ($this->masterMenu as $key => $value)
                        {
                            $masterMenu =    $value['id'];
                        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I am trying to run this query in SQL but it is not
If I run this query in Toad: SELECT BANDID, BANDNAME FROM WOODSTOCK WHERE BANDNAME
If I try to run this query in SQL Server 2005: SELECT 1 WHERE
I am getting an error when I run this query because the data type
I have the following query, now the strange thing is if I run this
I have a custom SQL query that I run with this line: @avg_score =
My scenario is this: I have a base NHibernate query to run of the
Hey guys I am getting this exception when trying to run the query Column
My XML document looks like this When I run XPATH query //collected_objects , I
I'm currently trying to run a LINQ query over a MS SQL database. This

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.