# PHP Query

**URL:** <https://forum.kirupa.com/t/php-query/200689>\
**Category:** programming\
**Created:** [September 14, 2006, 8:13am UTC](https://forum.kirupa.com/t/php-query/200689 "2006-09-14T08:13:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paxdev](https://avatars.discourse-cdn.com/v4/letter/p/6a8cbe/32.png) [@paxdev](https://forum.kirupa.com/u/paxdev)\
**Post date:** [September 14, 2006, 8:13am UTC](https://forum.kirupa.com/t/php-query/200689/1 "2006-09-14T08:13:13Z")

</div>

Hi,  
I have 2 tables Order & Orderdetail  
For each Order , there are several rows in the Order Detail table. I need a format like  
Name, Order id  
and then a list of all the orders details.

But my query pulls all the data and repeats the Name & Order id repeatedly.

In MS Access I used a Shape command, but in MYSQL I’m not sure how to do it.

Here is my query

```php
 
$result1 = mysql_query("SELECT * ,b.total FROM orderdet a,orders b WHERE a.orderId =$orderno");

```

Thanks
