nolanpro Posted June 25, 2010 Share Posted June 25, 2010 Why does this work: $stmt->bind_param('s', $param); But this does not: $stmt->bind_param('s', $array[0]); In this test: $stmt = $db->prepare('select id from letters where letter = ?'); $stmt->bind_param('s', $array[0]); $array = array('a', 'b', 'c'); $param = 'a'; $stmt->execute(); $stmt->bind_result($id); while($stmt->fetch()) { echo "Id: $id\n"; } When both $param and $array[0] are the same thing! "a" (php 5.3, mysql 5.0) Quote Link to comment https://forums.phpfreaks.com/topic/205899-mysqli-statement-bind_param-using-array-or-object-element-var/ Share on other sites More sharing options...
nolanpro Posted June 27, 2010 Author Share Posted June 27, 2010 Anyone? I guess I'll have to post a bug at bugs.php.net and get the proverbial "This is not a bug, its a feature" response.... Quote Link to comment https://forums.phpfreaks.com/topic/205899-mysqli-statement-bind_param-using-array-or-object-element-var/#findComment-1077734 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.