Remove duplicates in Array
Posted: 2021-08-26 20:26
Hello my AppGini family,
I have created a report that is based on the Udemy course Ahmed put out to make an invoice. I have modified it and have almost got the report to look as I need. One thing that is still unfixed is how to eliminate duplicate entries in the report. Duplicates are required in the data base, but I don't want them to appear in the printed report. Below is the code I am currently using. It pulls out all the records, duplicates and all. Any suggestions are appreciated.
I have created a report that is based on the Udemy course Ahmed put out to make an invoice. I have modified it and have almost got the report to look as I need. One thing that is still unfixed is how to eliminate duplicate entries in the report. Duplicates are required in the data base, but I don't want them to appear in the printed report. Below is the code I am currently using. It pulls out all the records, duplicates and all. Any suggestions are appreciated.
Code: Select all
<?php
$haz_cont = array();
$haz_cont_fields = get_sql_fields('haz_cont');
$haz_cont_from = get_sql_from('haz_cont');
$res = sql("select {$haz_cont_fields} from {$haz_cont_from} and rfp_id={$rfp_id}", $eo);
while($row = db_fetch_assoc($res)){
$haz_cont[] = $row;
}
?>