Mysql select with LIKE and php variable
-
- Posts: 39
Mysql select with LIKE and php variable
How can i create a %Like select where variable is a php variable.
Admin
Posts: 805
I think, like this sql:
Code: Select all
$varnm ='value';
$sql = "SELECT * FROM table_name WHERE col_name LIKE '%$varnm'";
mluci12
Posts: 39
how can i put 2 col_name in this sql ?
Admin
Posts: 805
Simple, like this:
Code: Select all
$varnm ='value';
$sql = "SELECT * FROM table_name WHERE col_1 LIKE '%$varnm' OR col_2 LIKE '%$varnm'";
Similar Topics
-
Multiple select for upload not working on mobile
JavaScript - jQuery - Ajax
First post
Plessant Coursesweb,Last post
meight useless to ask but it seems this upload for picture-album is not working on my mobile-page
but on my computer I just...
Try to search on the internet for:
html multiple select upload mobile