Function to get a DISTINCT row
<p>There are lots of articles on getting distinct rows through a sql statement but I havent found the help I need after a SQL statement has already run. Im very new to PHP and I am using the DHTMLX library to render a grid. The unusual syntax used to render the grid is throwing me off big time. What I want is simply distinct rows in my grid only. Everything works great, I just need help getting a function together that will return distinct rows. In my code below I managed to get the two functions that are commented out to work great so I have been using them as a roadmap but I just can't pull the "distinct function" together due to a lack of familiarity with loops. Can someone help me with the syntax needed to have this function return distinct rows. I think array_unique will come into play but Im pretty lost at this point. </p>

<pre><code>&lt;?php
require("codebase/grid_connector.php");
$res = mysql_connect("localhost", "1newuser", "");
mysql_select_db("supplydb");



function distinct($result)
{
    $grab = array_unique($rows-&gt;get_value("group"));

}



/*function formatting($row){
$data = $row-&gt;get_value("gpo_item");
if ($data == 1)
$row-&gt;set_value("gpo_item",Yes);
else
$row-&gt;set_value("gpo_item",No);
}    */
/*function calck($action){
$data1 = $action-&gt;get_value("list_price");
$data2 = $action-&gt;get_value("sugg_price");
$sum = (($action-&gt;get_value("sugg_price") / $action-&gt;get_value("list_price")) - 1) * 100 ;
$sum2 = round($sum);
$sum3 = abs($sum2);        
$action-&gt;set_value("discount",$sum3);
}    */
$gridConn = new GridConnector($res, "MySQL");
//$gridConn-&gt;event-&gt;attach("beforeRender","formatting");
//$gridConn-&gt;event-&gt;attach("beforeRender","calck");
$gridConn-&gt;event-&gt;attach("beforeRender", "distinct");
$gridConn-&gt;render_sql("SELECT * FROM manufacturers JOIN submissions on manufacturers.manufacturer_id=submissions.manufacturer_id JOIN products on products.product_id=submissions.product_id JOIN product_group on submissions.category=product_group.id", "submission_id", "date,man_name,group,requesting_clinician, requesting_clinician_email, contract_number");
?&gt; 
</code></pre>
