0

我在表 City 中使用 fetch_assoc 遍历行。然后,当我遍历行时​​,我想将每行具有的值与表订阅者的值进行比较。我不想遍历订阅者表的每一行,我只想比较它在 City 列上的值。

我不想遍历订阅者表的每一行,我只想比较它在 City 列上的值。

这是我的代码:

$query = "SELECT Location1,Location2,Location3,Location4,Location5,Location6,Location7,Location8 FROM City";

if ($result = mysqli_query($conn, $query)) {

while($row=mysqli_fetch_assoc($result)) {


$Location1 =  $row['Location1'];
$Location2 =  $row['Location2'];
$Location3 =  $row['Location3'];
$Location4 =  $row['Location4'];
$Location5 =  $row['Location5'];
$Location6 =  $row['Location6'];
$Location7 =  $row['Location7'];
$Location8 =  $row['Location8'];






$sql = mysql_query('SELECT City, Email FROM Subscriber');

我希望比较订阅者的城市列是否等于城市的任何位置。

4

0 回答 0