Can mysql query statements in php be used like this? Can the mysql query statement of {code...} php be used like this?
$query = "SELECT name FROM bank WHERE area LIKE 'aaa'";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_array($result)) { $http = $row['http']; $task_query = "SELECT * FROM task WHERE link LIKE'%$http%'"; $task_result = mysql_query($task_query) or die(mysql_error()); while($task = mysql_fetch_array($task_result)); echo $task['high'].'
'; }
Reply content:
Can mysql query statements in php be used like this?
$query = "SELECT name FROM bank WHERE area LIKE 'aaa'";$result = mysql_query($query) or die(mysql_error());while($row = mysql_fetch_array($result)) { $http = $row['http']; $task_query = "SELECT * FROM task WHERE link LIKE'%$http%'"; $task_result = mysql_query($task_query) or die(mysql_error()); while($task = mysql_fetch_array($task_result)); echo $task['high'].'
'; }
SELECT *FROM task JOIN (SELECT http AS zhttp FROM bank WHERE area LIKE 'aaa') AS Z ON task.link LIKE CONCAT('%', Z.zhttp, '%')
SELECT * FROM bank LEFT JOIN task ON task.link LIKE concat('%', bank.http, '%') WHERE bank.area = 'aaa'
I think you may needJOIN
....
select task.high from task left join bank on task.link like concat('%', bank.http. '%') where bank.area like 'aaa'
You are$task_query = "SELECT * FROM task WHERE link='%$http%'";
Here we want to get the effect of fuzzy match. How can we use it?=
What about it?