desjardins2010 Posted March 25, 2014 Share Posted March 25, 2014 $user_query = "SELECT * FROM `referrals`"; $user_querys = $con -> query($user_query); $count_query = $user_query -> num_rows; if ($count_query !=0) { while ($row = $user_querys -> fetch_assoc()) { $id = $row['id']; $REG_DATE = $row['regdate']; $username = $row['username']; $refd_user = $row['refd_user']; $commission = $row['commission']; $acct_status = $row['acct_status']; anyone tell me why this Trying to get property of non-object is happening on line $user_querys = $con -> query($user_query); Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted March 25, 2014 Share Posted March 25, 2014 $con isn't an instance of your database object. it is either something else (a boolean...) or it doesn't exist at all (a null...) in the program scope where you are trying to use it. Quote Link to comment Share on other sites More sharing options...
desjardins2010 Posted March 25, 2014 Author Share Posted March 25, 2014 I include connection file at the top this page that sets my connection $con = mysqli_connect("$host","$user","$password","$database"); Quote Link to comment Share on other sites More sharing options...
Solution trq Posted March 25, 2014 Solution Share Posted March 25, 2014 Then your connection is failing. You should always check that $con is what your expecting it to be before just going ahead and blindly using it. 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.