SELECT * FROM file_list INNER JOIN members ON file_list.user_id = members.user_id WHERE members.username_mem = 'user' AND members.province LIKE '% file_list.file_location % '
SELECT * FROM file_list INNER JOIN members ON file_list.user_id = members.user_id WHERE members.username_mem = 'user' AND members.province LIKE '% file_list.file_location % '
ลองเป็น
$sql="SELECT file_list .*, members.* FROM file_list
INNER JOIN members ON (file_list .user_id = members .user_id)
WHERE members.username_mem = 'user' AND members.province LIKE '%file_list.file_location%'";
อืมผิดตรงไหนหว่าลองยัด like แบบตรงๆดูครับ ว่ามันจะออกไหม
Code (PHP)
$sql="SELECT file_list.*, members.* FROM file_list
INNER JOIN members ON (file_list.user_id = members.user_id)
WHERE members.username_mem = 'user' AND members.province LIKE '%ยกมาซักตัว%'";
SELECT file_list.*, members.* FROM file_list INNER JOIN members ON (file_list.user_id = members.user_id) WHERE members.username_mem = 'user' AND members.province LIKE '%นนทบุรี%'
SELECT file_list.*, members.* FROM file_list INNER JOIN members ON (file_list.user_id = members.user_id) WHERE members.username_mem = '$rec_session' AND members.province LIKE '%$rec_data%'