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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:31:51+00:00 2026-06-12T03:31:51+00:00

I have been following a tutorial to better understand php’s oop, but have come

  • 0

I have been following a tutorial to better understand php’s oop, but have come across a stumbling block, im not sure if it’s an oop thing or something that i just haven’t come across in the procedural way of doing things, i’m pretty new and trying to learn a lot quickly. I like to know what’s happening before moving on.

Below is the code, which I understand apart from why under users_username i need ‘, and another ‘, before selecting users_email? At first I thought it was a way of separating them so as a test I removed them and was returned the error: Trying to get property of non-object. So I am guessing by removing them i am somehow stopping the name being created as an object? or am I way off the mark.

"SELECT CONCAT(users_username,
                        ',
                        ',
                        users_email)
                        AS name,
          DATE_FORMAT(users_joined, '%M %d, %Y') AS dr
          FROM users
          ORDER BY users_joined
          ASC";

    $r = $mySqli->query($q);//run the query

    $num = $r->num_rows;//assign the number of rows

    if($num > 0){//if there are members in the database

        echo '<p>There are currently ' . $num . ' members registered.</p>' . "\n";

        while($row = $r->fetch_object()){

            echo $row->name . ' ' . $row->dr . "<br/>";

        }
    }

Apologies if this has been asked many times before but I didn’t know how to search this question.

  • 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-12T03:31:52+00:00Added an answer on June 12, 2026 at 3:31 am

    What CONCAT(users_username, ‘,’,users_email) is doing is taking the users_username appending a comma and then appending the users_email. So if users_username is bob and users_email is bob@example.com that will return “bob,bob@example.com”.

    If you remove the single quotes then it is just CONCAT(users_username,,,users_email) and PHP might not like that there is nothing between the commas. In this case the query may be failing and returning NULL for $row. So when you do $row->name it tries to get the name property of $row but since $row is NULL it doesn’t have any properties.

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

Sidebar

Related Questions

I have been following an opengl tutorial, but for some reason when i added
i have been following apps snowfall tutorial, but i am getting some issue in
http://developer.android.com/training/basics/firstapp/building-ui.html I have been following this tutorial, but I have two errors, both R
I have been following this tutorial http://www.android10.org/index.php/articleslibraries/291-twitter-integration-in-your-android-application I entered these details for the consumer_key
I have been following a tutorial on how to write a basic tile map
I have been following the tutorial on Microsofts website and they use GameTime to
I'm a newcomer to Rails, and have been following the tutorial on the rails
I have been following the affableBean tutorial from the NetBeans site located here .
I have been following a short tutorial to build a tab menu on my
I'm new to NHibernate... I have been following this NHibernate Tutorial from Gabriel Schenker

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.