hance2105 Posted July 9, 2013 Share Posted July 9, 2013 hello guys, i am selecting records from 3 tables (2 more to come later) but when i echo the result, no error messages are displayed and no records are being retrieved. please verify the code below and let me know where i erred. <?php session_start(); include('db_connect.php'); $username = $_SESSION['username']; $user = mysql_fetch_assoc(mysql_query("select user_id from tbllogin where username = '{$username}'")); $sql = ("SELECT prod_id FROM tblfavourites WHERE user_id = '$user[user_id]'"); $sql1 = ("SELECT ret_id FROM tblfav_ret WHERE user_id = '$user[user_id]'"); $query = mysql_query("SELECT p.prod_name, rp.prod_price, r.ret_nameFROM tblproduct AS pLEFT JOIN tblretprod AS rp ON (rp.prod_id = p.prod_id)LEFT JOIN tblretailer AS r ON (r.user_id = rp.user_id)WHERE p.prod_id IN ($sql) AND r.ret_id IN ($sql1)"); $row = mysql_fetch_row($query); echo $row['prod_name']; ?> Link to comment https://forums.phpfreaks.com/topic/279996-mysql-code-displaying-no-data-on-echo/ Share on other sites More sharing options...
hance2105 Posted July 27, 2013 Author Share Posted July 27, 2013 solved it out myself finally Link to comment https://forums.phpfreaks.com/topic/279996-mysql-code-displaying-no-data-on-echo/#findComment-1442427 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.