What does "Call to undefined function mysqli_query()&qu

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

What does "Call to undefined function mysqli_query()&qu

Post by christian_phpbeginner »

Hi folks, I don't understand, why does this error shows up when it is running on the web server, but not on my local server ?
Fatal error: Call to undefined function mysqli_query() in......on line xx
I have read an article that I searched from google. It says that in order mysqli_query to work, I need to use mysqli_connect, which I have done it even before I found the article. But it doesn't seem to work and I do not know why ?

Thank you,
Chris
User avatar
bmcewan
Forum Commoner
Posts: 55
Joined: Wed Jun 02, 2004 7:19 am
Location: West Yorkshire, UK.

Post by bmcewan »

most likely that extension is not installed on your production server, phpinfo(); should be of some help.
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

Hi, thanks for the reply. Yes, you're right, they don't support mysqli. But they allow me to create my own php.ini file, is it still possible if I just copy and paste the "extension=php_mysqli.dll" ??? There is a link to create a php.ini, but when I click on it, I have only an empty textarea and commented "WRITE YOUR PHP EXTENSIONS HERE..." ....

Thanks again,
Chris
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Isn't there any documentation for this feature?
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

No volka, nothing !....I asked the technical support and it took them for like 24 hours to answer ! They say they support for the mysqli extension. But this morning, I tested it using phpinfo(); still the extension mysqli doesn't in the list !

So, if they don't support it. Means that I should change my mysqli into mysql ?

Thanks,
Chris
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

I'd verify that they support custom php.ini's, then if you must, place one where they say you can place it. Otherwise, yes, use the MySQL extension.

For portability to other hosts you may want to set up your code so it may run either.
User avatar
christian_phpbeginner
Forum Contributor
Posts: 136
Joined: Sat Jun 03, 2006 2:43 pm
Location: Java

Post by christian_phpbeginner »

I have changed it into mysql_query().

The web hosting doesn't support mysqli because they don't installed the extension by reason, which is that the mysqli functions are not yet stable, compared to mysql.

Thanks to all of you who have replied !

Sincerely,
Chris
Post Reply