mysql - using LIKE %% with LEFT JOIN -


ok, used "like" "left join" , works fine.

$sql = $conn->query("select * tasks t                       left join users u                       on t.allowed_countries u.country                       u.username = '$username'"); 

but when i'm try use "like %%" instead of using "like" gives me error

like '%" u.country "%' 

can tell me problem please?

thank you.

use concat % char literal.

like concat('%',u.country,'%') 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -