mysql - PHP prepared statement always returns 1 -
i tryed call function prepared statement
stmt= $conn->prepare("select create_user(?,?,?)"); $tt="test"; $stmt->bind_param("sss",$tt,$tt,$tt); $stmt->execute(); echo "return value".$stmt->fetch();
the returnvalue shouldn't 1 function working if call way directly in mysql console function working correctly , applying changes return value allways 1 no matter it's returning on console tried execute statement check if there mistake in function there 4 rows in table
$stmt=$conn->prepare("select count(name) users"); $stmt->execute(); echo $stmt->fetch();
the result (it's 1 again) same if $stmt->store_result();
before fetching result i'm working mysql db
you have try this:
$stmt=$conn->prepare("select count(name) count users"); $stmt->execute(); $stmt->bind_result($count); $stmt->fetch(); echo $count
Comments
Post a Comment