Hi,
I'm having trouble getting the information I need from my mysql db.
I need to write a query that gets me:
A list of all combinations of answers from 8 columns and the frequency of them. Every row contains answers from 1 person from a survey and I want to check if there are some combinations of answers that are more common than others. The columns holds either "Y" or is empty.
Next query is from a table where I want to sum a column only from them whos unique id only exists once in the table and are "new_custumors".
This is what i attempted without luck:
$query = mysql_query("SELECT sum(approved_amount) as approved FROM loanaccount_Backup1 WHERE type='new_customer' AND distinct(main_id) ");
if ($query) {
while ($row = mysql_fetch_assoc($query)) {
$approvedvolym .= $row['approved'];
}
} else {
print('MySQL query failed with error: ' . mysql_error());
} ;
Take care
Adam