Hello, im not sure if this makes sence or but here we go. I have 2 tables, the first one i have queried to get the users name, id and their category id's. These category id's are stored in a field in the format of 3,4, etc...
I need to seporate this array so that i ca match the single id's to another table.
It displays everything else, but i think the if statment is not excuting?
Any help greatly appreciated, as i'm not to good with arrays.
##########################################
$sql = "SELECT * FROM hesk_users";
$result = hesk_dbQuery($sql) or hesk_error("Couldn't execute SQL: $sql<br>Please contact webmaster at $hesk_settings[webmaster_mail] and give him this error message");
$sql_category = "SELECT * FROM hesk_categories";
$result_category = hesk_dbQuery($sql_category) or hesk_error("Couldn't execute SQL: $sql_category<br>Please contact webmaster at $hesk_settings[webmaster_mail] and give him this error message");
$cat=substr($myuser['categories'], 0, -1);
$myuser['categories']=explode(",",$cat);
while ($myuser2=hesk_dbFetchAssoc($result))
{
while ($row=hesk_dbFetchAssoc($result_category))
{
if (in_array ($row[id],$myuser['categories'])) {
echo "$row[categories]";
}
}
echo <<<EOC
<tr onMouseover="this.bgColor='#B0C4DC'" onMouseout="this.bgColor='#5C88BF'">
<td class="$color">$myuser2[name]</td>
<td class="$color">
</td>
</tr>
EOC;
} // End while