php - $stmt->store_result() not return mysqli_result -


perhaps duplicate question, have read many threads deal issue , can not find solution, if indeed duplicate question , apologize if not mind give me link can me. problem this: reasons of hosting plan can not use 'mysqli_stmt_get_result ()' try change script wrote (i'm learning php), run query have no way obtain results of consultation if obtenia using 'mysqli_stmt_get_result ()', alternative trying result 'mysqli_store_result' according documentation alcanso read (as understand) "returns buffered result object or false if error occurred." should (if goes well) give me same result have 'mysqli_stmt_get_result ()' , should return "false" in case went wrong, boolean = true. me i'm doing wrong ?, easy replacement of 'mysqli_stmt_get_result ()'? fragment of have code:

$link = new mysqli(     "localhost",     "root",     "rootpass",     "db" ); echo "\n\n\n"; if (mysqli_connect_errno()){ echo "failed connect mysql: " . mysqli_connect_error(); exit(); } if($_get){   $where_value = trim(htmlspecialchars($_get["where"])); }else{   if(count($argv)>1){     $where_value = trim($argv[1]);   }else{     $where_value = '';   } } if($where_value != ''){   if($stmt = $link->prepare('select * tabla_1 id=?')){     $stmt->bind_param('i', $where_value);    }else{     echo mysqli_stmt_errno;     exit();   } }else{   if(!$stmt = $link->prepare('select * table_1')){     echo mysqli_stmt_errno;     exit();   } } $stmt->execute(); $result = $stmt->store_result(); // store "true" must 'mysqli_result'  // point none work because $result boolean not 'mysqli_result' $resultarray = array(); $temparray = array(); while($row = $result->fetch_array(mysqli_num)){   $temparray = $row;   array_push($resultarray, $temparray); } mysqli_close($con); echo json_encode($resultarray); 

'mysqli_stmt_bind_result' not option me because table has lots of columns, unless can use array 'mysqli_stmt_bind_result'.

my sistem is:

php --version php 5.6.9-0+deb8u1 (cli) (built: jun  5 2015 11:03:27)  copyright (c) 1997-2015 php group zend engine v2.6.0, copyright (c) 1998-2015 zend technologies     zend opcache v7.0.4-dev, copyright (c) 1999-2015, zend technologies lsb_release -a no lsb modules available. distributor id: debian description:    debian gnu/linux 8.1 (jessie) release:        8.1 codename:       jessie uname -a linux iwakura-pc 3.16.0-4-amd64 #1 smp debian 3.16.7-ckt11-1 (2015-05-24) x86_64 gnu/linux 

please appreciated


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -