Hey,
Cant really understand this, can someone point out where I'm going wrong
please?

The idea is simple, I have 3+ names of clients in the database, each client
has multiple records
with the same order_id and name (because they are registered with multiple
products):
eg:
order_id  Name Product
565454   Ryan   211
565454   Ryan   11
565454   Ryan   617
845874   susan   44
845874   susan   857
698457   Jacob  211

The idea is to present just one unique name in the control panel. Since I am
paginating I am getting
the correct COUNT of 3, but when I display it...it shows me something like:
Ryan
Ryan
susan

As you can see its repeating the first one twice and not displaying "Jacob"

Since you cant read my mind ( unfortunately :-p ) heres the code that I am
using:

***** start code ****

// for the paginator (am using a class)
$num_rows = mysql_result(mysql_query("SELECT COUNT(DISTINCT(order_id)) FROM
".$tcname."_h2o"),0);

$a =& new Paginator($_GET['page'],$num_rows);
$a->set_Limit(10); // Records to be displayed.
$a->set_Links(4);
$limit1 = $a->getRange1();
$limit2 = $a->getRange2();


// for the control panel display
$result=mysql_query("SELECT distinct(order_id),name,status,total FROM
".$tcname."_h2o LIMIT $limit1, $limit2");

// if($result)
while($row = mysql_fetch_row($result))
 {
$up_name=ucwords($row[1]);
echo <<<something2
  <tr>
    <td>$up_name</td>
    <td nowrap>$row[4]</td>
    <td nowrap>$the_status</td>
    <td NOWRAP><div align="center">Edit ::</div></td>
    <td><div align="center">Options</div></td>
  </tr>
something2;

 } // End of while

***** end code ****

The above part is just the main parts of course, if you want the whole page
tell me and I'll
give it too you offlist and I dont like getting attachments on list and I am
pretty sure I'm not
the only one.

Any ideas where I am going wrong?

Thanks,
-Ryan

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to