1

I want to select all rows from my table except for one, so I added a condition where not exists, but I had an error saying "Parse error: syntax error, unexpected '') '' (T_CONSTANT_ENCAPSED_STRING)"

here is my code :

$query = 'select * from etudiant where NOT EXISTS (select * from etudiant where matricule ='.$new_matricule') ';
                $exec = $this->db->query($query);

Canyou tell me please what I have done wrong?

1 Answers1

0

Syntax error Add a dot

$query = 'select * from etudiant where NOT EXISTS (select * from etudiant where matricule ='.$new_matricule.') ';
Shahbaz A.
  • 4,047
  • 4
  • 34
  • 55