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

  • Home
  • SEARCH
  • 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 6164927
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T22:04:38+00:00 2026-05-23T22:04:38+00:00

I have a MySQL table set up using phpMyAdmin which you can view in

  • 0

I have a MySQL table set up using phpMyAdmin which you can view in the images below:

Table Structure

And here is the populated table:

Categories

The problem I have is when I issue the following query, no results are returned. I am struggling to work out why.

<?php

$db_host     = 'localhost';
$db_user     = 'root';
$db_pass     = 'root';
$db_database = 'bbg_db_2'; 

$dbc = mysql_connect($db_host,$db_user,$db_pass);
$sdb = mysql_select_db($db_database);

$query = "SELECT category_name, category_desc FROM categories";
$result = mysql_query($sdb, $dbc, $query) or die (mysql_error($dbc));

while ($row = mysql_fetch_array($result)) {

   $catname = $row["category_name"];
   $catdesc = $row["category_desc"];

   echo "<li>$catname</br><span>$catdesc</span></a></li>";
}
?>

When I issue this query I get no error messages and no results displayed. All I am trying to do is get a list of all these categories with their descriptions. Any Ideas?

  • 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-23T22:04:41+00:00Added an answer on May 23, 2026 at 10:04 pm

    Your parameters to mysql_query are wrong. The results of mysql_select_db do not belong there, and the query should be the first parameter.

    Check out the documentation for every function you use.

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

Sidebar

Related Questions

I have a mysql table field set as time type which stores data in
I have a DATE datatype mysql column in a table. I want to set
I have a mysql table with over 4 million of data; well the problem
I have a MySQL table which has three columns: Authority | MapID | Time
I have a large mysql table that I think might be using the wrong
Heres my problem. I have a mysql table called quotes. In one of the
So I'm using PHP/MySQL and I have a tbl_profile table with the following fields:
I have a MySQL database/table set up and a .php file online that inserts
I have a MySql table whose primary key is a 64bit BigInt I'm using
Original Question mysql-server-6.0.10 I have this problem, I'm using the COMPRESS function to update

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.