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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T16:57:36+00:00 2026-06-16T16:57:36+00:00

I have knowledge of PHP but I am still learning Json. First of all

  • 0

I have knowledge of PHP but I am still learning Json. First of all I want to clear what I am looking for. I have two tables in mysql database, table1(users) and table2(business). Table “users” contains these rows(id, uid, business_name) and table “business” contains these rows(id, uid, category).

I have following code in PHP page:

if(isset($_GET['catName'])) {

    $cat = $_GET['catName'];
    $stmt = $pdo->prepare("SELECT id, uid, category FROM business WHERE category = ? ");
    $stmt->execute(array($_GET['catName']));
    $arr = $stmt->fetchAll(PDO::FETCH_ASSOC);

}

I am able to get json output on my html page e.g.
101, 102, 103 and so on.

But I want to get business_name rows like ABC Business, XYZ Business, 123 Business and so on from second table “business” based on the output uid from first table. In brief, I want business_name output instead of uid output from second table.
Please help me. Thank you so much in advance.

  • 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-16T16:57:37+00:00Added an answer on June 16, 2026 at 4:57 pm

    Thank you so much Chris and Jormundir. Joining the both tables really solved my problem. This is what I have done:

    $stmt = $pdo->prepare(“SELECT business.uid, users.business_name FROM business,users WHERE business.uid = users.uid AND business.category= ? “);

    In html page I have put “business_name” array instead of “uid” and I have got result whatever I was looking for.

    Thanks you so much all of you.

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

Sidebar

Related Questions

I'm new to PHP programming and have poor knowledge about it, but I want
I dont know much about classes, but have a reasonable knowledge of PHP/MySQL. But
I have a good knowledge of PHP. But I also want to learn technologies
I am not strong on my PHP knowledge, but I have never seen this
My knowledge of xml and php is somewhat basic but have been able to
I am fairly new to PHP, but have applied my previous knowledge of programming,
I am working on Moodle but have a php-mysql related doubt which is turning
I have no knowledge of Python. I started with .NET and than learned PHP.
I need some help with PHP Class. I have limited knowledge about how it
With my limited knowledge of Magento and PHP I have found myself possibly on

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.