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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:34:27+00:00 2026-06-07T15:34:27+00:00

I am trying to determine if any differences exist between a number of fields

  • 0

I am trying to determine if any differences exist between a number of fields between rows of a mysql database.

for example, if name field is different in one row echo a result out.

What is the best method for this?

edit:

for example

Name          AGE
john smith    68
john smith    68
John M Smith  68

I would like a script that detect the name in the third line is different to the others but to be able to do this for both name and age fields

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

    You first have to think about: Different to what? You always have to define a value a column should have. If you want all rows which are not “john smith” with age 68, your statement would be the following:

    SELECT * FROM table WHERE name <> "john smith" AND age <> 68;
    

    That will return all rows that are different to the defined values.

    A very basic PHP code example would be the following:

    $mysqli = new mysqli('hostname', 'username', 'password', 'database');
    
    $query = 'SELECT * FROM table WHERE name <> "john smith" AND age <> 68';
    
    if($result = $mysqli->query($query)){
        while($row = $result->fetch_assoc()){
            // do something with the results using $row['name'] and $row['age']
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to determine when any of a set of named input/select/radio/checked/hidden fields in
I'm trying to determine the differences between two collections. private ObservableCollection<SomeObject> _objectList = null;
I'm trying to determine if a database of a certain name exists and then
I'm trying to determine how to count the matching rows on a table using
Trying to determine best way to code this requirement : Need to insert rows
I'm trying to determine the relationship between default values and the has_foo() methods that
I'm currently trying to determine the amount of time between two dates (one of
I'm trying to determine if any changes were made to a particular entity object.
I'm trying to determine how much heap any given TYPE_INT_ARGB BufferedImage will use so
Im trying to determine why there would be space between 2 Containing Divs as

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.