Pass variable into the IN

Asked

Viewed 49 times

1

I’m having a hard time passing a variable into the IN in Mysql - PHP - PDO.

The URL looks like this: /PESO=50&IDADE=18,20

Code:

$read->FullRead("SELECT DISTINCT NOME FROM pessoas WHERE PESO =:peso AND IDADE IN (:idade) AND SEXO =:sexo", 'peso='.$_GET['PESO'].'&idade='.$_GET['IDADE'].'&sexo"=MASCULINO');
  • 1

    What is $read? What is FullRead?

  • What mistake are you making?

  • Try to take a look at what was done in this example of the OS in English; it seems that the PDO is not very good for parameterized IN clauses, in the query: https://stackoverflow.com/a/14767651/4649737

  • $read and my Object and Fullread and the method I use of this object.

No answers

Browser other questions tagged

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