acctman Posted September 11, 2007 Share Posted September 11, 2007 the row's below (i.e $row['m_user'] , etc) re not pulling any data, no errors are being displayed either <? $userid = '39'; // Get the total referrals $request = mysql_query(" SELECT SUM(ref_points) AS totalPoints, COUNT(*) AS totalRef FROM rate_referrals WHERE ref_userid = $userid GROUP BY ref_userid") or die(mysql_error()); list ($totalPoints, $totalRef) = mysql_fetch_row($request); mysql_free_result($request); $request = mysql_query(" SELECT COUNT(*) FROM rate_referrals WHERE ref_userid = $userid AND (ref_status = 0 OR ref_status = 1)") or die(mysql_error()); list ($pendingReferrals) = mysql_fetch_row($request); mysql_free_result($request); // Get the referal id, referal member, total points and so on. $request = mysql_query(" SELECT mem.m_id, mem.m_date, mem.m_type, mem.m_user, ref.ref_id, ref.ref_mem, ref.ref_userid, ref.ref_status FROM rate_referrals AS ref LEFT JOIN rate_members AS mem ON (ref.ref_userid = mem.m_id) WHERE ref.ref_userid = $userid AND ref.ref_status = 2") or die(mysql_error()); echo ' <h1>Total Points ' . $totalPoints . '</h1> <h1>Total Referrals ' . $totalRef . '</h1> <h1>Pending Referrals ' . $pendingReferrals . '</h1> <table> <tr> <td>Name</td> <td>Gender</td> <td>Date</td> <td>Status</td> <tr>'; while ($row = mysql_fetch_assoc($request)) { echo ' <tr> <td>' . $row['m_user'] . '</td> <td>' . ($row['m_type'] == 2 ? 'Male' : 'Female') . '</td> <td>' . $row['m_date'] . '</td> <td>' . $row['ref_status'] . '</td> </tr>'; } mysql_free_result($request); echo ' </table>'; ?> Quote Link to comment Share on other sites More sharing options...
Barand Posted September 11, 2007 Share Posted September 11, 2007 Finding no matching records is not an error. Quote Link to comment 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.