I am have MySQL query table
customer_id name service
1 a sms
2 b inbox
1 a 2-way
here the customer_id 1
have two data ,when i write the query to retrieve the data from database and display it in table it only taking the first value for example customer_id 1 having sms and inbox it only displaying inbox not displaying sms
,but i want to display the both like this (sms,2-way),can any one gude how to do it.
my code:
<?php
$sql_selectcustomer = "SELECT customer_id,name FROM `customer` where reseller_id=1 ";
$result1 = mysql_query($sql_selectcustomer);
while($rows=mysql_fetch_assoc($result1))
{
$customer_id=$rows['customer_id'];
$customer_name=$rows['name'];
$sql_service = "SELECT product FROM `products` where customer_id='$customer_id'";
//print $sql_service;
$result_service = mysql_query($sql_service);
while($row1=mysql_fetch_assoc($result_service))
{
$product = $row1['product'];
//print $product;
}
echo '<tr>';
echo ' <td class="edit name '.$rows["customer_id"].'">'.$customer_name.'</td>
<td class="edit product '.$rows["customer_id"].'">'.$product.'</td>
</tr>';
}
?>