I have a while loop which is printing out rows from search results, one column in the search result is 'Area Name'. Now I want to check if that area name is also in another result set, and if it is, make the product clickable.
This is my while loop for search results:
<table id="" class="table table-striped table-bordered display" cellspacing="0" width="100%">
<thead>
<tr>
<th>Customer Code</th>
<th>Customer Name</th>
<th>Customer Type</th>
<th>Name</th>
<th>Postcode</th>
</tr>
</thead>
<tbody>
<?php while($customer = sqlsrv_fetch_array($querySearchResults, SQLSRV_FETCH_ASSOC)) : ?>
<tr>
<td><?php echo $customer['CardCode'] ?></td>
<td>
//If $customer['Name'] = to any of the rows in other query
//This is Clickable
<?php echo $customer['CardName']; ?>
//Else its not.
</td>
<td><?php echo $customer['CardType'] ?></td>
<td><?php echo $customer['Name'] ?></td>
<td><?php echo $customer['ZipCode'] ?></td>
</tr>
<?php endwhile; ?>
</tbody>
</table>
This is the other Query:
$userID = $user['loggedInUserId'];
$queryName = "
SELECT UserID, Name
FROM Table
WHERE UserID = '$userID'";
$getName = sqlsrv_query($sapconn2, $queryName);
$Name = sqlsrv_fetch_array($getName, SQLSRV_FETCH_ASSOC);
What would the if statement need to be in this case?