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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:44:04+00:00 2026-06-15T23:44:04+00:00

Learning PHP and I have a question. How does one obtain an element from

  • 0

Learning PHP and I have a question.

How does one obtain an element from an array and determine if it is equal to a static value? I have a return set from a query statement (confirmed the array has all values).

I tried:

<?  if($row["rowValue"] == 1) { 
    }
?>

I was expecting the value to be 1, but it’s returning null (as if I’m doing it wrong).

  • 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-15T23:44:05+00:00Added an answer on June 15, 2026 at 11:44 pm

    You’re pretty much there; something like this should confirm it for you:

    echo "<p>Q: Does ".$row["rowValue"]." = 1?</p>";
    if($row["rowValue"] == 1) {
        echo "<p>A: Yes ".$row["rowValue"]." does equal 1</p>";
    } else {
        echo "<p>A: No, '".$row["rowValue"]."' does not equal 1</p>";
    }
    

    If that’s still returning ‘No’ you could try viewing the whole of the $row array by doing a var dump of the array like so:

    var_dump($row);
    

    This will give you detailed output of how the array is built and you should be able to see if you are calling the correct element within the array.

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

Sidebar

Related Questions

I am coming from the world of PHP and am learning Ruby/Rails. I have
I have been learning PHP for some time now and I wanted one clarification.
I'm pretty new to php but i'm learning pretty fast, I have a question
I'm still learning php and have run up against what should be a relatively
I have committed to learning C now, I'm good with Python/PHP/Bash but I've decided
I'm new to learning php and in one of my first programs I wanted
I have developed a membership script with php for learning and I have confused
This is a two part question; firstly, does anyone out there have some insight
I have just started learning PHP and I want to create a website with
I have a question that pertains to gathering events from tables in a calendar

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.