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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:01:49+00:00 2026-05-25T16:01:49+00:00

I have one problem regarding retriving data from database. I have created one database

  • 0

I have one problem regarding retriving data from database. I have created one database in userrecord and its table name is tbl_user. I am trying to display the user information when they log in the system. i.e view logged user profile. The code is as follows:

<?php
    include("auth_user.inc.php"); // authrization page
    $uname=$_SESSION['user']; // logged user name
    $connection=mysql_connect("localhost","root"," ");
    mysql_select_db("userrecord",$connection);
    $sql=("select * from table_user where uname ='$uname'");
    $result=@mysql_query($sql,$connection);
    $row=mysql_fetch_array($result);
?>
<html>
    <head>
        <title>User Account</title>
    </head>
    <body bgcolor="#33CCFF">
        <br>Your Details Information Is Shown Below:<br><br>
        First Name:<?php echo $row['fname'];?><br>
        Last Name:<?php echo $row['lname'];?><br>
        Address:<?php echo $row['address'];?><br>
        E-Mail:<?php echo $row['email'];?><br>
        Gender:<?php echo $row['fname'];?><br>
        User Name:<?php echo $row['uname'];?><br>
    </body>
</html>

The code echo $row[‘ ‘] is not displaying the record from database.

  • 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-25T16:01:49+00:00Added an answer on May 25, 2026 at 4:01 pm

    try:

    <?php
        include("auth_user.inc.php"); // authrization page
        $uname = $_SESSION['user']; // logged user name
        $connection = mysql_connect("localhost","root"," ") or die('Could not connect to database: '.mysql_error());
        mysql_select_db("userrecord",$connection) or die('Could select database: '.mysql_error());
        $sql = "select * from table_user where uname ='$uname'";
        $result = mysql_query($sql) or die ('Mysql error: '.mysql_error.' - '.mysql_errno());
        $row = mysql_fetch_array($result);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have one problem , I want to get some data from XML file
I have one problem regarding the data insertion in PHP. In my site there
I have this logical problem regarding on how to pass value from one JFrame
I have a problem regarding to asp.net lifecylce hierarchy. Basically, I have one user
I'm doing a simple program regarding methods. But I have one problem. Everything is
I am using mootools1.2 as my js framework. I have one problem regarding the
I have one small problem regarding MPMoviePlayerController, i have a link that play movie
I got a problem regarding parsing XML data. I have divided my program into
I have one problem to work with NSMutableData . I defined one NSMutableData *receivedData
I have one problem, I learn how work with socket and I write programm

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.