Having more issues with mysqli. Numerical data in results

osisorlo

New Member
When I do a print_r, I get a number 1 between the array blocks. I have no idea where it is coming from.This is causing errors in my log. I can fix this by testing with is_array but I want to know where this is coming from.I'm making two queries but yet I have a third array in there. What is going on?????\[code\]mysqli_result Object( [current_field] => 0 [field_count] => 2 [lengths] => [num_rows] => 110 [type] => 0)mysqli_result Object( [current_field] => 0 [field_count] => 1 [lengths] => [num_rows] => 12 [type] => 0)1 <-------------------------------------HEREmysqli_result Object( [current_field] => 0 [field_count] => 1 [lengths] => [num_rows] => 1 [type] => 0)\[/code\]\[code\]$this->conn->query("CALL phoneIsRegistered($phone,@phone)");$res = $this->conn->query("SELECT @phone");\[/code\]\[code\] $result = mysqli_query($this->conn, $query) or die('Error: '.mysqli_error($this->conn)); if($result) { while($row = $result->fetch_object()) { if($row) { print_r($row); } } $this->disconnect(); }\[/code\]This is what the loop looked like before I began trying to find this.\[code\] $this->connect(); $result = mysqli_query($this->_conn, $query) or die('Error: '.mysqli_error($this->conn)); if($result){ $i=0; $res = array(); while($row = $result->fetch_object()){ if($row){ $res[$i++] = $row; } } $this->disconnect(); return $res; }else{ return false; }\[/code\]
 
Back
Top