L
L
LyciferZla2018-07-15 08:09:54
PHP
LyciferZla, 2018-07-15 08:09:54

How to make comparison on two parameters?

Good day, please tell me how to compare 2 parameters with a POST request from the database? For example, if the First Name, Last Name and Date of Birth match, then do not write down the data, and if not, then write it down. Here's how I compare the data from the POST request with the data from the database. Tell me please!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
LyciferZla, 2018-07-15
@LyciferZla

in the end, while waiting for an answer, I solved this problem myself, I don’t know if it will come in handy for someone:

if( R::exec('SELECT * FROM `dlepisode1` WHERE `nickname` = ? AND `games` = ?', array($data['nickname'], $data['gamesname'])) > 0)

K
kisaa, 2018-07-15
@kisaa

Create a composite key on the fields Last Name, First Name, Date of Birth, and use INSERT ... ON DUPLICATE KEY UPDATE:
https://dev.mysql.com/doc/refman/8.0/en/insert-on-...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question