Php and MysQL JOIN tree table -
i have 1 question join
php
section .
i know question have in stackoverflow.com solution not helped me.
i using code join 2 table:
<?php $select_posts = "select users.uid,users.user_name,user_uploads.uid_fk,user_uploads.image_path users join user_uploads on users.uid = user_uploads.uid_fk user_name='$user_name' order rand() limit 0,4"; $run_posts = mysql_query($select_posts); while($row=mysql_fetch_array($run_posts)) { $image_path=$row['image_path']; $uid_fk = $row['uid_fk']; ?>
this code work want add table here.
other table name is: message
table inside have:
msg_id uid_fk comment_count like_count
how can add third table here? can me!
just join third table join keyword in query.
select table_users.uid,table_users.user_name,table_user_uploads.uid_fk,table_user_uploads.image_path, table_message.msg_id table_users join table_user_uploads on table_users.uid = table_user_uploads.uid_fk join table_message on table_message.uid_fk = table_users.uid user_name='$user_name' order rand() limit 0,4
Comments
Post a Comment