Answer the question
In order to leave comments, you need to log in
Why does the like operator work differently?
Mysql, PHP, Apache (web site)
I use the like operator in my SQL query.
PHP code is the same. The data is different. The result of the behavior of the like operator is different. Weird.
(The code is used in conjunction with ajax - a drop-down list, everything is standard.)
//keyword - title of the work (text). For example - "Building a big house"
$select_result=mysql_query("SELECT * FROM `my_table` WHERE `job_name` like '".$keyword."%' ORDER BY job_name");
if (is_numeric($keyword)==true)
{
$select_result=mysql_query("SELECT * FROM `my_table` WHERE `job_value` like '".$keyword."%' ORDER BY job_value");
}
Answer the question
In order to leave comments, you need to log in
Condition does not work
is_numeric('1.') // true
is_numeric('1.1') // true
is_numeric('1.1.') // false
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question