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!