Hello I am trying to look after content of Selected query... but however the error appears:
mysqli_num_rows() expects parameter 1 to be mysqli_result ...
$stmt= $this->conn->prepare("SELECT * FROM table") or die(mysql_error());
$result = $stmt->execute();
// check for empty result
if (mysqli_num_rows($result) > 0) {
..
}
EDIT NEW ERROR mysqli_fetch_array() expects parameter 1 to be mysqli_result, object given in...
$stmt= $this->conn->prepare("SELECT * FROM table") or die(mysqli_error());
$stmt->execute();
$stmt->store_result();
// check for empty result
if ($stmt->num_rows > 0) {
// looping through all results
$response["array"] = array();
while ($row = mysqli_fetch_array($stmt)) {
... }
I think I got it:
while ($row = $stmt->fetchAll()) {
// temp user array
$array= array();
$array["bla"] = $row["bla"];
... }
but I get only "null" as value...?
EDIT
Now i got it:
$stmt->bind_result($column1, $column2...)
then
$array["bla"] = $column1; $array["bla2"] = $column2;
but isn't it possible to bind_result all colums without to put every single one into a variable? or isnt it possible to use this :
$array["bla"] = $row["bla"];
so it puts the value from the row with the column "bla" into $array[bla]?
because the way i solved it, seems to be veyr difficult