TampaBay55 Posted February 21, 2012 Share Posted February 21, 2012 Greeting all. I am brand new to the forum and I would like to ask a question regarding mysqli. I am not certain why the following code works: ... $sqlCmd = "select * from usrdata"; $rs = $mysqli->query($sqlCmd); ... and the following code gives me a 500 internal error: ... $sqlCmd = "select * from usrdata"; $result= dbQuery($sqlCmd); ... function dbQuery($sqlCmd){ $rt = array(); $rs = $mysqli->query($sqlCmd); while($row = $rs->fetch_assoc ()){ $rt[] = $row; } return 'records: ' . json_encode($rt); } The error occurs on the mysqli->query. Thanks for any help. Cheers! Quote Link to comment https://forums.phpfreaks.com/topic/257469-mysqli-question/ Share on other sites More sharing options...
scootstah Posted February 21, 2012 Share Posted February 21, 2012 Check the Apache error.log Quote Link to comment https://forums.phpfreaks.com/topic/257469-mysqli-question/#findComment-1319599 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.