Page 1 of 1

Retrieve more data

Posted: Sat May 19, 2012 6:06 pm
by arunjoseph
According to your blogging tutorial data from post and comment table is retrieved. But what if I want to retrieve data from categories table and which has a cat_id, cat_name and users table that has u_id and user_name. So in the get_posts() function I want the cat_name and user_name to retrieve this thing. Clear with the question? Please let me know. In my posts table there is p_id, p_title, p_body, cat_id, user_id

Re: Retrieve more data

Posted: Sat May 19, 2012 7:57 pm
by Temor
I'm not sure I understand what your problem is. Are you trying to fetch information from another table?
What have you tried so far?

Re: Retrieve more data

Posted: Mon May 21, 2012 7:40 am
by arunjoseph
Actually yes.. and with that the progress is something like I tried to expand the sql statement that was made by Jacek but it didn't go so good..

Re: Retrieve more data

Posted: Mon May 21, 2012 11:30 am
by Temor
You would probably have to write a new sql statement.
SELECT `cat_id`, `cat_name`, `u_id`, `user_name` FROM `another_table`
if that is what you mean. Without seeing any code I'm not actually too sure what you want to accomplish :P