i am trying to get 2 column in dataset from a query my query is:
SELECT cs.name,cs.rank,w.idw ,w.name,w.address FROM custom cs,work w WHERE cs.id='".$name."' and cs.idcs=w.idcs";
But i don't want the result, which i would show to user will have duplicate info( where cs.name, cs. rank would showup in every row). i want to let user see the result like this:
**Custom's info:**
ID:xyzqwe
Name: ABC company
Rank: VIP
**Work list**
ID| Name|Address
1 |A | 123 adc
2 |B | 432 cali
.............
I tried to fill custom's info with
echo "Name:".mysqli_fetch_array($rs)->['cs.name'];
echo "Rank:".mysqli_fetch_array($rs)->['rank'];
but all i got is syntax error. I am newbie after all. Please some one give me an advice or hint. Thank in advance.
You can get the data from below code
while($row=mysql_fetch_assoc($data))
{
$name = $row['Name'];
}