Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Installed php 5.4.21, but getting 'undefined method mysqli_stmt::get_result() ' still?

Discussion in 'Database Discussion' started by morrow95, Nov 16, 2013.

  1. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    123
    Likes Received:
    3
    Trophy Points:
    168
    I am in the process of rewriting into prepared statements and have the following :

    Code:
    	// Store user db info in session for use
    	$stmt = $mysqli->prepare("SELECT id,user,pass,email,timezone,lastIP,currIP,dtLastLogin,dtCurrLogin FROM test_users WHERE user = ?");
    	// bind params
    	$stmt->bind_param('s', $user);
    	// execute prepared statement
    	$stmt->execute();
    	// results to array
    	$rs = $stmt->get_result();
    	$arr = $rs->fetch_all(MYSQLI_ASSOC);
    	// close statement
    	$stmt->close();
    	//store array into session
    	$_SESSION['user']= $arr;
    
    but am getting a 'Fatal error: Call to undefined method mysqli_stmt::get_result() '. I realized my php was an older version and went ahead and installed 5.4.21 through easy apache.. confirmed with echo phpversion(); and still get the error.

    I was under the assumption that 5.4 would correct this issue with the native driver needed for this statement... is that wrong? MySQL version is 5.1.70-cll.

    Any ideas?
     
  2. mtindor

    mtindor Well-Known Member

    Joined:
    Sep 14, 2004
    Messages:
    1,344
    Likes Received:
    58
    Trophy Points:
    178
    Location:
    inside a catfish
    cPanel Access Level:
    Root Administrator
    I was under the impression that mysqlnd is not provided by default in a cPanel install [because, at least at one point, mysqlnd would not authenticate against 16-byte old style passwords]. In a fairly old thread somewhere on the forum here, cPanelKenneth was telling somebody this. This was in a PHP 5.3 discussion. I don't know if it's still true or not.

    But if you need mysqlnd, I think you'll have to add something to rawopts and recompile to have that support in your PHP. I'm not a programmer, so I don't know if mysqlnd is what you're referring to, but I presume it is when you say 'native driver'.

    You might want to do a search on these forums for cpanel mysqlnd, or you can do a Google search for cpanel mysqlnd and you'll find what I'm referring to.

    Mike
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    123
    Likes Received:
    3
    Trophy Points:
    168
    Yes, mysqlnd is what I am talking about. Afterwards I also found the same references here on the forum. Apparently it isn't included still.

    I went ahead and rewrote what I needed to in PDO last night and am good to go. Just glad I found out now rather than later. I still had quite a bit of work to rewrite regardless.
     
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,803
    Likes Received:
    1,898
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    I am happy to hear you were able to get that sorted out. Thank you for updating the thread with the outcome.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice