Why does my mysqli::get_result function break?

December 4, 2014 4.2k views

So i’ve looked all over for information about this, and I found something that says that mysqli::get_result doesn’t work for PHP 5.4 and below, but running phpinfo() says that im on 5.5. I’m running and Ubuntu LAMP server, and the whole code works just fine on my XAMPP on OSX. The following is the code in question:

                if ($videos = $mysqli->prepare("SELECT htmlcode FROM content WHERE datatype = 'Video' AND username = ?")) {
                    $result = $videos->get_result();
                    while ($row = $result->fetch_array(MYSQLI_NUM))
                        foreach($row as $r) {
                            echo "$r";
                } else {
                        return false;

Please help! Thanks.

1 Answer

WELL, Resolved. I hope other people that run into this issue will see this.

I ran :

sudo apt-get install php5-mysqlnd

because php5-mysql does not support it. GOOD NEWS

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!