I have a standard select query which selects all records from the products
table and then display it in a table.
I need another query to run after that based on the result, in order to get the a field from the customers
table.
So for example. my query from the products
table shows the user_id
field. I need to run a SQL query simultaneously in order to get the user_name
from the customers
table.
$result = mysqli_query($con,"SELECT * FROM products (SELECT eu_name FROM customer WHERE $id_mobile = $id_mobile");
echo "<table border='1'>
<tr>
<th>user_id</th>
<th>user_name</th>
<th>selected_product</th>
while($row = mysqli_fetch_array($result, MYSQLI_ASSOC))
echo "<td>" . $row['eu_name'] . "</td>";
echo "<td>" . $row['user_name'] . "</td>";
echo "<td>" . $row['selected_product'] . "</td>";