Jump to content

Convert mysql database function to mysqli


Go to solution Solved by boompa,

Recommended Posts

Hi,

I am using a grid function which creates a data grid based on the query provided. this is rich & now i find that i need to convert all functions into mysqli compatible. 

 

below are the error lines

 

            // execute the query through the "database" object
            $this->queryResult = $this->dbRefference->query($this->query);
            // get the total number of records in the result (ignoring the LIMIT)
            $this->totalRecords = $this->dbRefference->foundRows;
 
this shows error as "Notice: Undefined property: mysqli_ext::$foundRows "
 
attaching the file for reference.
 
any help is highly appreciated.
 
Thanks

class.datagrid-backup.php

  • Solution

This is the manual page for mysqli.

 

Do you see anything called foundRows there? Maybe there's something else there that accomplishes what you want.

 

Please learn to read your errors, understand them, and reference the PHP manual.

Edited by boompa

you need to modify the database class to use mysqli statements, not replace the database class with an instance of the mysqli class. what was the original code for the database class? perhaps it is already using mysqli or pdo and you don't need to do anything?

Well, I have completed the changes. By doing this, I am using a single object in all of my components that access db in a php page. i m hopeful that it will improve my performance, else i will again see you guys in this forum.

 

thanks for all your help. This forum is really helpful for every question I have. 

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.