paparts Posted May 21, 2009 Share Posted May 21, 2009 Hi guys can i ask a help about this query. I have 3 tables and I need to have the output on the image. Thanks in adv. Attached is the image and a clearer view of the problem [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/159066-php-mysql-query/ Share on other sites More sharing options...
Ken2k7 Posted May 22, 2009 Share Posted May 22, 2009 SELECT CONCAT_WS(' ', t1.fname, t1.lname) AS name, t1.address AS Address, t2.pname AS `Product Bought` FROM table1 t1 INNER JOIN table3 t3 ON (t1.user_id = t3.user_id) INNER JOIN table2 t2 ON (t3.prod_id = t2.prod_id) Quote Link to comment https://forums.phpfreaks.com/topic/159066-php-mysql-query/#findComment-839676 Share on other sites More sharing options...
paparts Posted May 22, 2009 Author Share Posted May 22, 2009 select * from table1 t1 table2 t2 table3 t3 where t1.user_id = t3.user_id and t3.prod_id = t2.prod_id; same as what I have. I am having troubles with my pagination because empty fields are displayed. Quote Link to comment https://forums.phpfreaks.com/topic/159066-php-mysql-query/#findComment-839728 Share on other sites More sharing options...
luca200 Posted May 22, 2009 Share Posted May 22, 2009 Empty fields? What do you mean ??? Quote Link to comment https://forums.phpfreaks.com/topic/159066-php-mysql-query/#findComment-839731 Share on other sites More sharing options...
paparts Posted May 22, 2009 Author Share Posted May 22, 2009 I have 3 data on the table and when I used the queries it displays a lot of pages with empty data. but on the first page it displays the 3 data and on the 2nd page its displays blank. I wonder why but anyway thanks a lot for the replies. Consider this post solved thanks.... Quote Link to comment https://forums.phpfreaks.com/topic/159066-php-mysql-query/#findComment-839734 Share on other sites More sharing options...
Ken2k7 Posted May 22, 2009 Share Posted May 22, 2009 What do you mean empty data? Are the rows empty or just a column? Quote Link to comment https://forums.phpfreaks.com/topic/159066-php-mysql-query/#findComment-839942 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.