Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
On 3/14/2009 10:36 AM, "Gary" wrote: > Can anyone enlighted me as to what I am not doing correctly? Hi Gary, I am hosted using a basic cpanel interface ... There's a button = Remote MySQL which brings up a page: Remote Database Access Hosts And I put in my HOME IP and all works fine now ... Not sure how godaddy does it... Maybe ask tech support How to set up Remote MySQL access -- Thanks - RevDave Cool @ hosting4days . com [db-lists 09] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > Thanks again to everyone. > > I have just checked the servers phpinfo, and turns out they are running PHP > Version 4.3.11 while I have verstion 5.2.8, could this change any of the > advice? Yes, the mysqli extension is only available for PHP5. Use the mysql_x() functions or move to a host that supports PHP5/mysqli extension. -- Thanks! -Shawn http://www.spidean.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Thanks again to everyone. I have just checked the servers phpinfo, and turns out they are running PHP Version 4.3.11 while I have verstion 5.2.8, could this change any of the advice? ""Jan G.B."" wrote in message news:c9a09d00903141132i19597e73g2271955d1ac14...@mail.gmail.com... Gary, you can check this by either creating a file containing this: and putting it up on your webserver, then open in with your browser, or you could look at the output of "php -i | less" on the command line. After you enabled the mysqli extension on your host, you might change mysqli_connect('$var', '$var2', ...); to mysqli_connect($var, $var2, ...) One side node.. you should apply addslashes() also to $_SERVER['REMOTE_ADDR'), because an evil person could manipulate the value of that variable to execute SQL-Injections. Bye 2009/3/14 Gary : > Thanks for your quick reply, but I do not know what that means... Where > would I find this out and how would I accomplish this if it is not done? > > Thanks again. > > "Per Jessen" wrote in message > news:gpgq8i$h5...@saturn.local.net... > Gary wrote: > >> I am recieving a fatal error trying to connect to my server/mysql. >> This is my first attempt at connecting to a remote server, have been >> successful with localhost (apache). I had the variation of not putting >> the hostname & others into a variable, but that did not work either. >> >> I have also genericised the username and password for this post. Host >> name is correct. >> >> Can anyone enlighted me as to what I am not doing correctly? >> >> >> Fatal error: Call to undefined function: mysqli_connect() in > > Check if the mysqli extension has been loaded. > > > /Per > > > -- > Per Jessen, Zürich (10.9°C) > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Ok.. I have added [MySQL] ;Gary, this is the code from the forum. extension=mysqli.so to the php.ini file on my machine, I saved the file. Is there anything else I need to do? Thanks again. "Per Jessen" wrote in message news:gpgu1t$ho...@saturn.local.net... Gary wrote: > I had the code written the way you suggested, but changed it to the > way the hosting company suggested. I think your hosting company might be smoking something they shouldn't be. Your way is the right one. > I am unclear. I have php 5.2.8.8 on my local machine, I also have > MySQL 5.1.30 set up locally as well. Okay. > I am using godaddy.com as a host. I assumed that the php was running > on the host server and the local php that I have/use is only for the > testing server. > > Does this sound correct to you? Let me paraphrase - you've been developing an application in your local environment, and you're now moving it to your hosting environment. It sounds very much like the mysqli extension isn't loaded (by default) in your hosting environment. Find out by calling phpinfo() - if there is no information from mysqli, the extension wasn't loaded. Or try using extension_loaded('mysqli') and see what that says. To load the extension, you could use dl() in your code although it might have been disabled. Otherwise you need to modify the correct php.ini and add the extension=mysqli.so line. /Per -- Per Jessen, Zürich (10.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Ok.. I have added [MySQL] ;Gary, this is the code from the forum. extension=mysqli.so to the php.ini file on my machine, I saved the file. Is there anything else I need to do? Thanks again. "Per Jessen" wrote in message news:gpgu1t$ho...@saturn.local.net... Gary wrote: > I had the code written the way you suggested, but changed it to the > way the hosting company suggested. I think your hosting company might be smoking something they shouldn't be. Your way is the right one. > I am unclear. I have php 5.2.8.8 on my local machine, I also have > MySQL 5.1.30 set up locally as well. Okay. > I am using godaddy.com as a host. I assumed that the php was running > on the host server and the local php that I have/use is only for the > testing server. > > Does this sound correct to you? Let me paraphrase - you've been developing an application in your local environment, and you're now moving it to your hosting environment. It sounds very much like the mysqli extension isn't loaded (by default) in your hosting environment. Find out by calling phpinfo() - if there is no information from mysqli, the extension wasn't loaded. Or try using extension_loaded('mysqli') and see what that says. To load the extension, you could use dl() in your code although it might have been disabled. Otherwise you need to modify the correct php.ini and add the extension=mysqli.so line. /Per -- Per Jessen, Zürich (10.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > I had the code written the way you suggested, but changed it to the > way the hosting company suggested. I think your hosting company might be smoking something they shouldn't be. Your way is the right one. > I am unclear. I have php 5.2.8.8 on my local machine, I also have > MySQL 5.1.30 set up locally as well. Okay. > I am using godaddy.com as a host. I assumed that the php was running > on the host server and the local php that I have/use is only for the > testing server. > > Does this sound correct to you? Let me paraphrase - you've been developing an application in your local environment, and you're now moving it to your hosting environment. It sounds very much like the mysqli extension isn't loaded (by default) in your hosting environment. Find out by calling phpinfo() - if there is no information from mysqli, the extension wasn't loaded. Or try using extension_loaded('mysqli') and see what that says. To load the extension, you could use dl() in your code although it might have been disabled. Otherwise you need to modify the correct php.ini and add the extension=mysqli.so line. /Per -- Per Jessen, Zürich (10.4°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
2009/3/14 Jan G.B. : > One side node.. you should apply addslashes() also to > $_SERVER['REMOTE_ADDR'), because an evil person could manipulate the > value of that variable to execute SQL-Injections. forget that part - i didn't see that this var is only used in the email, not in the query. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary, you can check this by either creating a file containing this: and putting it up on your webserver, then open in with your browser, or you could look at the output of "php -i | less" on the command line. After you enabled the mysqli extension on your host, you might change mysqli_connect('$var', '$var2', ...); to mysqli_connect($var, $var2, ...) One side node.. you should apply addslashes() also to $_SERVER['REMOTE_ADDR'), because an evil person could manipulate the value of that variable to execute SQL-Injections. Bye 2009/3/14 Gary : > Thanks for your quick reply, but I do not know what that means... Where > would I find this out and how would I accomplish this if it is not done? > > Thanks again. > > "Per Jessen" wrote in message > news:gpgq8i$h5...@saturn.local.net... > Gary wrote: > >> I am recieving a fatal error trying to connect to my server/mysql. >> This is my first attempt at connecting to a remote server, have been >> successful with localhost (apache). I had the variation of not putting >> the hostname & others into a variable, but that did not work either. >> >> I have also genericised the username and password for this post. Host >> name is correct. >> >> Can anyone enlighted me as to what I am not doing correctly? >> >> >> Fatal error: Call to undefined function: mysqli_connect() in > > Check if the mysqli extension has been loaded. > > > /Per > > > -- > Per Jessen, Zürich (10.9°C) > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
I had the code written the way you suggested, but changed it to the way the hosting company suggested. I am unclear. I have php 5.2.8.8 on my local machine, I also have MySQL 5.1.30 set up locally as well. I am using godaddy.com as a host. I assumed that the php was running on the host server and the local php that I have/use is only for the testing server. Does this sound correct to you? Again, many thanks. "Per Jessen" wrote in message news:gpgruj$hc...@saturn.local.net... Gary wrote: > Ok, I know how to access the php.ini for the local host, is this the > same file that would control the remote server? Or do I need to look > for it on my remote host? The php.ini you need to look at is the one one the server where you're running your PHP code. The remote host is just your database server I assume? Your code does look a little odd though: $dbc = mysqli_connect('$hostname','$username','$password') or die('Error connecting to MySQL server'); mysql_select_db('$usertable'); I would have written this as: $dbc = mysqli_connect($hostname,$username,$password,$usertable) or die('Error connecting to MySQL server'); /Per -- Per Jessen, Zürich (10.7°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > Ok, I know how to access the php.ini for the local host, is this the > same file that would control the remote server? Or do I need to look > for it on my remote host? The php.ini you need to look at is the one one the server where you're running your PHP code. The remote host is just your database server I assume? Your code does look a little odd though: $dbc = mysqli_connect('$hostname','$username','$password') or die('Error connecting to MySQL server'); mysql_select_db('$usertable'); I would have written this as: $dbc = mysqli_connect($hostname,$username,$password,$usertable) or die('Error connecting to MySQL server'); /Per -- Per Jessen, Zürich (10.7°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Ok, I know how to access the php.ini for the local host, is this the same file that would control the remote server? Or do I need to look for it on my remote host? Again, thanks for your help. "Per Jessen" wrote in message news:gpgr6o$hc...@saturn.local.net... Gary wrote: > Thanks for your quick reply, but I do not know what that means... > Where would I find this out and how would I accomplish this if it is > not done? > > Thanks again. Hi Gary see what phpinfo() says - if the extension is loaded, it'll show up there. To load the extension, add "extension=mysqli.so" to your php.ini (if it's not already there). /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > Thanks for your quick reply, but I do not know what that means... > Where would I find this out and how would I accomplish this if it is > not done? > > Thanks again. Hi Gary see what phpinfo() says - if the extension is loaded, it'll show up there. To load the extension, add "extension=mysqli.so" to your php.ini (if it's not already there). /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Thanks for your quick reply, but I do not know what that means... Where would I find this out and how would I accomplish this if it is not done? Thanks again. "Per Jessen" wrote in message news:gpgq8i$h5...@saturn.local.net... Gary wrote: > I am recieving a fatal error trying to connect to my server/mysql. > This is my first attempt at connecting to a remote server, have been > successful with localhost (apache). I had the variation of not putting > the hostname & others into a variable, but that did not work either. > > I have also genericised the username and password for this post. Host > name is correct. > > Can anyone enlighted me as to what I am not doing correctly? > > > Fatal error: Call to undefined function: mysqli_connect() in Check if the mysqli extension has been loaded. /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
On Sat, Mar 14, 2009 at 13:41, Per Jessen wrote: > > Check if the mysqli extension has been loaded. Also check this page: http://us.php.net/manual/en/mysqli.connect.php For some of the mirrors, trying to hit http://php.net/mysqli_connect erroneously takes you to the mysql_connect() function documentation. It's a bug of which we *are* aware and are working to repair. -- daniel.br...@parasane.net || danbr...@php.net http://www.parasane.net/ || http://www.pilotpig.net/ 50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW1 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Fatal error: Call to undefined function: mysqli_connect() in
Gary wrote: > I am recieving a fatal error trying to connect to my server/mysql. > This is my first attempt at connecting to a remote server, have been > successful with localhost (apache). I had the variation of not putting > the hostname & others into a variable, but that did not work either. > > I have also genericised the username and password for this post. Host > name is correct. > > Can anyone enlighted me as to what I am not doing correctly? > > > Fatal error: Call to undefined function: mysqli_connect() in Check if the mysqli extension has been loaded. /Per -- Per Jessen, Zürich (10.9°C) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php