I'm collecting data from 3 tables, of which one of the tables (social_meminfo) has multiple rows for results. How can I isolate the results of social_meminfo identifying each rows results? Or should I use two separate queries? At there should be at least two rows that would be found. Also instead of using `$en['m'.$key]` I want to use `$en['b'.$key]`
Code:
$res = mysql_query("SELECT *, DATE_FORMAT(sm.m_lld,'%m/%d/%y')
AS m_lld_formatted
FROM social_members sm
JOIN social_meminfo smi ON (sm.m_id = smi.m_id)
LEFT OUTER JOIN social_memtext smt ON (sm.m_id = smt.m_id)
WHERE sm.m_user = '".mysql_real_escape_string($en['user'])."'");
if (mysql_num_rows($res) == 0) call404();
#while ($line = mysql_fetch_assoc($res)) {
$line = mysql_fetch_assoc($res);
foreach ($line as $key => $value) {
$en['m'.$key] = str_replace("\n",'<br/>',stripslashes($value));
}
or should I just use two queries and a while statement?