0

I'm only receiving data from the first table social_members and not the two other tables _meminfo and _memtext. both tables have data in them with the same m_id value that is in _meminfo and _memtext.

$res = mysql_query("SELECT sm.*, 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(); $line = @mysql_fetch_assoc($res); foreach ($line as $key => $value) { $en['m'.$key] = str_replace("\n",'<br/>',stripslashes($value)); } echo '<pre>'; print_r($line); echo '</pre>'; echo $en['mm_pos']; // test from social_meminfo 

2 Answers 2

2

in your query you explicitly say that you only want data from the social_members table.

SELECT sm.* .... 

has that effect (sm.* = all the columns from the table aliased as sm). if you want all the columns generated by your query, then you should instead do

SELECT * .... 
Sign up to request clarification or add additional context in comments.

Comments

1

You need to mention social_meminfo and social_memtext columns in your SELECT clause.

try this

SELECT * from ..... 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.