mysqli-stmt-bind-result

From: Date: Fri, 27 Aug 2004 10:18:15 +0000
Subject: mysqli-stmt-bind-result
Groups: php.doc 
Request: Send a blank email to phpdoc+get-969363541@lists.php.net to get a copy of this message
Hi, in http://www.php.net/manual/en/function.mysqli-stmt-bind-result.php it remains unclear whether bind_result must be called after every execute or if one call for many statements of a kind is sufficient. I.e. I use a prepared SELECT statement: // prepare $stmt = $mysqli->prepare( "SELECT title FROM books WHERE title LIKE ? LIMIT 5"); $stmt->bind_param('s', $pattern); // first execution of SELECT command $pattern="%Linux%"; $stmt->execute(); $stmt->bind_result($title); while($stmt->fetch()) printf("<br />%s\n", $title); // second execution of SELECT command, with different pattern $pattern="%MySQL%"; $stmt->execute(); // IS THE FOLLOWING bind_result NECESSARY? // $stmt->bind_result($title); while($stmt->fetch()) printf("<br />%s\n", $title); $stmt->close(); I kind of answered my question myself -- it works without a second call of bind_result. However, is this just good luck or is this the intended behavior? Best wishes,
             Michael Kofler
http://www.kofler.cc/

« previous php.doc (#969363541) next »