Jump to content

how to grab things from 2 tables in a database?


Glenskie

Recommended Posts

ok i need to grab things from two tables in my database , here is my code that i was using , but i changed my friend table so i need to change my code ! here is what i had ... i dont need m.friend_array anymore , the table is friends and the rows in the table are id , mem_1 , mem_2 , and Date... thank you so much!!!!

<?php 



$query = mysql_query("SELECT

p.id, p.to_id, p.from_id, p.post, p.type, p.state, p.date,

m.friend_array

FROM myMembers AS m

LEFT JOIN posts AS p ON p.to_id = m.id

WHERE p.state = '0' AND m.id = '" . $logOptions_id . "'" );	









if(mysql_num_rows($query)==0)

{

?>

<div class="no-info">There are no posts! or you have no friends!</div>

<?php 

}

else

{

posts($query);





}





?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.