Her’s my probleme, i guess its really basic.
I’m trying to lookup in the database if a line does exist. heres my code :
$req="SELECT * FROM INSTITUTS WHERE inst_name='$fc_inst'";
$result=mysql_query($req) or die ('Erreur :'.mysql_error());
if (mysql_num_rows($result)){
echo ' name exist';
}
else {
echo ' does not exist.';
}
Probleme is, when imm looking for “test”, it says does not exist, even if i have “Test” in my database.
you can use
LIKE:Or you can cast both lowercase with:
The example with
LOWER()is most effective where you know that all of your data in the database is already lower cased and then you can just execute:This would be a cheaper comparison than the
LIKEif you can lower case all of the data in your database.