nodirtyrockstar Posted October 31, 2012 Share Posted October 31, 2012 Here is my mysqli query: SELECT `artwork`,`artist`,`title`,`label`,`year`,`price`,`id` FROM `products` WHERE (`qty` <> 0) AND (`agedOff` <> 1); I know this query works. I typed it into the mysqladmin window and it returned the desired results. Here is the variable setup & database query: $artwork = ''; $artist = ''; $title = ''; $label = ''; $year = 0; $price = 0.00; $id = ''; $vars = array(&$artwork, &$artist, &$title, &$label, &$year, &$price, &$id); //I placed the ampersands before the array values, because bind_results requires that you pass as reference if (!$stmt = $mysqli->prepare($query)) { echo "Prepare failed: (" . $mysqli->errno . ") " . $mysqli->error; } if (!$stmt->execute()) { echo "Execute failed: (" . $stmt->errno . ") " . $stmt->error; } if (!call_user_func_array(array($stmt, 'bind_result'), $vars)) { echo "Binding results failed: (" . $stmt->errno . "( " . $stmt->error; } if($stmt->fetch) { //this part does not execute } The error message I receive is: "Notice: Undefined property: mysqli_stmt::$fetch in /hermes/waloraweb073/b2264/moo.katc/cobra/lib/distro.php on line 75 Fetching results failed: (0)" Can someone point me in the right direction please? Quote Link to comment https://forums.phpfreaks.com/topic/270100-call_user_func_array-with-bind_result/ Share on other sites More sharing options...
Jessica Posted October 31, 2012 Share Posted October 31, 2012 fetch is a function. You're trying to access a property. Quote Link to comment https://forums.phpfreaks.com/topic/270100-call_user_func_array-with-bind_result/#findComment-1388907 Share on other sites More sharing options...
nodirtyrockstar Posted October 31, 2012 Author Share Posted October 31, 2012 Doh!! Thank you! I thought for sure I got the call_user_func_array part wrong. Quote Link to comment https://forums.phpfreaks.com/topic/270100-call_user_func_array-with-bind_result/#findComment-1388911 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.