Build a script for similar information (PHP, Procedure, etc.)

Asked

Viewed 49 times

0

In a database I have registration information as:

  • age
  • color
  • heaviness

That of each person registered.

How to identify people who have exactly the same data on this basis?

In practice:

  • Edu, 46, white, 70kg
  • Bio, 46, white, 70kg --> that gave equality 100% .

  • Edu, 46, white, 70kg

  • Leo, 36, white, 60kg --> that gave equality 80%

Then the first option would be the desired.

  • You already have your comparison function?

  • When should it do so? It is a user request?

  • I do not have the function of comparison, this routine can run in the background in the database (hence would not be a PHP) actually in the question I put PHP but should be PL SQL or Procedure

1 answer

0

From what I understand you want to do a search of all users and then compare the information of each.

For this you need to fetch all users from the database.

Here you can see everything you need to know in mysql if that’s the case for PHP:

https://secure.php.net/manual/en/book.mysql.php

Then the comparisons part I advise to do in php using the functions mysql_fetch_assoc among others to go through the information and make the proper comparisons.

  • Pedro, thanks for the feedback, is what I need, but I need at least the structure of this PHP code, because I do not know how to start, so much so that I think part of this comparison function could be done by the bank, or not?

  • I believe that it is more difficult on the part than on the database since PHP can transform the select of the data into a manipulable array

Browser other questions tagged

You are not signed in. Login or sign up in order to post.