|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-01-14 16:57 UTC] mauroi at digbang dot com
[2005-01-26 17:12 UTC] mauroi at digbang dot com
[2005-02-04 14:59 UTC] georg@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 19:00:01 2025 UTC |
Description: ------------ I'm trying to bind the parameters for a SELECT query using the mysqli extension. So, I prepare the query, bind the variables, execute, an obtain the result. But in the obtained result I can fetch row (the correct quantity), I can fetch the fields, but it doesn't return any data.... Reproduce code: --------------- $handle = new mysqli('x.x.x.x', 'x', 'x', 'x'); $stmt = $handle->prepare('SELECT User.User FROM User WHERE User.User = ? AND User.Password = ?'); $user = 'plenque'; $pass = 'plenque'; $stmt->bind_param('ss', $user, $pass); $stmt->execute(); $result = $handle->store_result(); echo '<pre>'; var_dump($result->fetch_fields()); var_dump($result->fetch_assoc()); echo '<pre>'; $result->close(); $stmt->close(); $handle->close(); Expected result: ---------------- array(1) { [0]=> object(stdClass)#4 (9) { ["name"]=> string(7) "User" ["orgname"]=> string(7) "User" ["table"]=> string(7) "User" ["orgtable"]=> string(7) "User" ["def"]=> string(0) "" ["max_length"]=> int(0) ["flags"]=> int(1) ["type"]=> int(253) ["decimals"]=> int(0) } } array(1) { ["User"]=> string(0) "plenque" } Actual result: -------------- array(1) { [0]=> object(stdClass)#4 (9) { ["name"]=> string(7) "User" ["orgname"]=> string(7) "User" ["table"]=> string(7) "User" ["orgtable"]=> string(7) "User" ["def"]=> string(0) "" ["max_length"]=> int(0) ["flags"]=> int(1) ["type"]=> int(253) ["decimals"]=> int(0) } } array(1) { ["User"]=> string(0) "" <----- ????????? }