The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

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

  1. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    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,281
    Likes Received:
    37
    Trophy Points:
    48
    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
     
  3. morrow95

    morrow95 Well-Known Member

    Joined:
    Oct 8, 2006
    Messages:
    83
    Likes Received:
    0
    Trophy Points:
    6
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    675
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I am happy to hear you were able to get that sorted out. Thank you for updating the thread with the outcome.
     
Loading...

Share This Page