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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T15:36:33+00:00 2026-06-11T15:36:33+00:00

I am learning MYSQL. I have copied this code from a learning website. The

  • 0

I am learning MYSQL. I have copied this code from a learning website.

The original code was

<?php
$conn = @mysql_connect('115.0.0.1','root','root');
if (!$conn) {
    die('Could not connect: ' . mysql_error());
}
mysql_select_db('mydb', $conn);
?>

I have modified the following localhost address, username, password and dbname as below code. Actually I am using Appserv as a server.

My Current Code

admin is my username
admin is my password
115.240.6.251 is my localhost address
users is my dbname

this is code where i am getting the users

<?php
include 'conn.php';
$rs = mysql_query('select * from users');
$result = array();
while($row = mysql_fetch_object($rs)){
    array_push($result, $row);
    }
echo json_encode($result);
?>

the above details i am using for appserv

after changed the original code when run the this application i am not getting any row from db

when i checked in sql i have rows for the given table.

Please guide me here.

Thanks in advance
Karthic

  • 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-11T15:36:34+00:00Added an answer on June 11, 2026 at 3:36 pm

    You need to add something like:

    
    $result = mysql_query("SELECT * FROM your_table");

    while($row = mysql_fetch_array($result))
    {
    echo $row['FirstColumnName'] . " " . $row['SecondColumnName'];
    }

    mysql_close($con);

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

Sidebar

Related Questions

I'm currently learning PHP and MySQL and I have been working from a basic
I am still learning MySQL queries and am stuck with this one. I have
I'm learning mysql and have been trying to get this working, but an error
I have just started learning MySQL and am having trouble extracting matching flights from
I'm learning currently php/mysql and I'm confused about this bit. After some heads scratching
I have been learning PHP/Mysql for a while. But don't yet know enough to
I'm learning PHP and MySQL and I'm creating a movies website for learning purposes.
I have found this popular PHP/MySQL Script called Zip Location by SaniSoft and it
So I have this MySQL 5.0.24 table select state, county, population from state_pops order
I am learning to use mysql for rails apps, and I finally have been

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.