Fatal error: Call to undefined function: mysqli_connect() in
Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 18:36:53 von gary
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
// Receiving variables
@$pfw_ip= $_SERVER['REMOTE_ADDR'];
@$first_name = addslashes($_POST['first_name']);
@$last_name = addslashes($_POST['last_name']);
@$company = addslashes($_POST['company']);
@$phone = addslashes($_POST['phone']);
@$email = addslashes($_POST['email']);
@$url = addslashes($_POST['url']);
@$comments = addslashes($_POST['comments']);
// Validation
if (strlen($phone) <8)
{
die("
Please
enter a valid phone
");
}
if (strlen($phone) >15)
{
die("Please
enter a valid phone
");
}
if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
{
die("Please
enter a valid email
");
}
// checks if bot
if ($_POST['address'] != '' ){
die("Changed field");
}
//Connect To Database
$hostname='h50mysql43.secureserver.net';
$username='myusername';
$password='mypassword';
$dbname='mydbname';
$usertable='tablename';
$dbc = mysqli_connect('$hostname','$username','$password')
or die('Error connecting to MySQL server');
mysql_select_db('$usertable');
$query = "INSERT INTO contact(first_name, last_name, company, phone, email,
url, comments) ".
"VALUES
('$first_name','$last_name','$company','$phone','$email','$u rl','$comments')
";
$result = mysqli_query($dbc, $query)
or die('Error querying database.');
mysqli_close($dbc);
//Sending Email to form owner
$pfw_header = "From: $email\n"
. "Reply-To: $email\n";
$pfw_subject = "Subject Message";
$pfw_email_to = "email@email.com";
$pfw_message = "Visitor's IP: $pfw_ip\n"
.. "name: $first_name . ' '.$last_name\n"
.. "company: $company\n"
.. "phone: $phone\n"
.. "email: $email\n"
.. "url: $url\n"
.. "comments: $comments\n"
@mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
echo("Thank
you for your submission, we will respond shortly!
");
echo "Thank you $first_name for your request
";
echo "We have the following information from you.
";?>
echo "First Name $first_name
";
echo "Last Name: $last_name
";
echo "Company Name: $company
";
echo "Phone Number: $phone
";
echo "Web Address: $url
";
echo "Email Address: $email.
";?>
echo "Your Comment: $comments
";
?>
echo 'Please review your information and feel free to correct any that may
be incorrect.
';?>
echo 'We will contact your shortly!';
?>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 18:41:38 von Per Jessen
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 puttin=
g
> the hostname & others into a variable, but that did not work either.
>=20
> I have also genericised the username and password for this post. Host=
> name is correct.
>=20
> Can anyone enlighted me as to what I am not doing correctly?
>=20
>=20
> Fatal error: Call to undefined function: mysqli_connect() in
Check if the mysqli extension has been loaded.
/Per
--=20
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: Fatal error: Call to undefined function: mysqli_connect()
am 14.03.2009 18:44:34 von Daniel Brown
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.brown@parasane.net || danbrown@php.net
http://www.parasane.net/ || http://www.pilotpig.net/
50% Off All Shared Hosting Plans at PilotPig: Use Coupon DOW10000
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 18:48:22 von 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$h5g$1@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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 18:57:44 von Per Jessen
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?
>=20
> Thanks again.
Hi Gary
see what phpinfo() says - if the extension is loaded, it'll show up
there. To load the extension, add "extension=3Dmysqli.so" to your
php.ini (if it's not already there).=20
/Per
--=20
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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 19:01:49 von gary
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$hcp$1@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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 19:10:27 von Per Jessen
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 =3D mysqli_connect('$hostname','$username','$password')
or die('Error connecting to MySQL server');
mysql_select_db('$usertable');
I would have written this as:
$dbc =3D mysqli_connect($hostname,$username,$password,$usertable)
or die('Error connecting to MySQL server');
/Per
--=20
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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 19:30:27 von gary
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$hcp$3@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: Fatal error: Call to undefined function: mysqli_connect()
am 14.03.2009 19:32:14 von ro0ot.w00t
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$h5g$1@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: Fatal error: Call to undefined function: mysqli_connect()
am 14.03.2009 19:34:52 von ro0ot.w00t
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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 19:44:17 von gary
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:c9a09d00903141132i19597e73g2271955d1ac14fab@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$h5g$1@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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 19:46:20 von Per Jessen
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.=20
> 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.
>=20
> 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. =20
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.=20
To load the extension, you could use dl() in your code although it migh=
t
have been disabled. Otherwise you need to modify the correct php.ini
and add the extension=3Dmysqli.so line.
/Per
--=20
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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 19:54:21 von gary
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$ho1$1@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: Fatal error: Call to undefined function: mysqli_connect() in
am 14.03.2009 19:54:21 von gary
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$ho1$1@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: Fatal error: Call to undefined function: mysqli_connect()in
am 14.03.2009 20:42:32 von Shawn McKenzie
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: Fatal error: Call to undefined function:mysqli_connect() in
am 14.03.2009 23:37:25 von revDAVE
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: Fatal error: Call to undefined function:mysqli_connect()in
am 15.03.2009 00:29:21 von Shawn McKenzie
revDAVE wrote:
> 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]
>
>
>
That web interface isn't using the mysqli functions, it probably
phpMyAdmin using the mysql functions. If you would read my previous
post you'd see that mysqli isn't supported under PHP4.
I guess I need to reply all instead of replying to the newsgroup as
people seem to not read anything I post to the newsgroup.
--
Thanks!
-Shawn
http://www.spidean.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Re: Fatal error: Call to undefined function:mysqli_connect()in
am 15.03.2009 00:31:58 von Shawn McKenzie
Shawn McKenzie wrote:
> revDAVE wrote:
>> 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]
>>
>>
>>
>
> That web interface isn't using the mysqli functions, it probably
> phpMyAdmin using the mysql functions. If you would read my previous
> post you'd see that mysqli isn't supported under PHP4.
>
> I guess I need to reply all instead of replying to the newsgroup as
> people seem to not read anything I post to the newsgroup.
>
FYI from previous post...
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: Fatal error: Call to undefined function: mysqli_connect() in
am 15.03.2009 00:36:54 von gary
Thank you to everybody, turns out that in the godaddy control panel, you
have the option of php4 or php5, and they have 4 as the default. A call to
gd and I was able to switch and it now works.
Thanks again for all your help!
Gary
""Gary"" wrote in message
news:D1.A0.60648.83BEBB94@pb1.pair.com...
>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
>
>
>
> // Receiving variables
> @$pfw_ip= $_SERVER['REMOTE_ADDR'];
> @$first_name = addslashes($_POST['first_name']);
> @$last_name = addslashes($_POST['last_name']);
> @$company = addslashes($_POST['company']);
> @$phone = addslashes($_POST['phone']);
> @$email = addslashes($_POST['email']);
> @$url = addslashes($_POST['url']);
> @$comments = addslashes($_POST['comments']);
>
> // Validation
> if (strlen($phone) <8)
> {
> die("Please
> enter a valid phone
");
> }
> if (strlen($phone) >15)
> {
> die("Please
> enter a valid phone
");
> }
>
> if (! ereg('[A-Za-z0-9_-]+\@[A-Za-z0-9_-]+\.[A-Za-z0-9_-]+', $email))
> {
> die("Please
> enter a valid email
");
> }
> // checks if bot
>
> if ($_POST['address'] != '' ){
>
>
> die("Changed field");
>
> }
> //Connect To Database
> $hostname='h50mysql43.secureserver.net';
> $username='myusername';
> $password='mypassword';
> $dbname='mydbname';
> $usertable='tablename';
>
> $dbc = mysqli_connect('$hostname','$username','$password')
> or die('Error connecting to MySQL server');
> mysql_select_db('$usertable');
>
> $query = "INSERT INTO contact(first_name, last_name, company, phone,
> email, url, comments) ".
> "VALUES
> ('$first_name','$last_name','$company','$phone','$email','$u rl','$comments')
> ";
>
> $result = mysqli_query($dbc, $query)
> or die('Error querying database.');
>
> mysqli_close($dbc);
>
> //Sending Email to form owner
> $pfw_header = "From: $email\n"
> . "Reply-To: $email\n";
> $pfw_subject = "Subject Message";
> $pfw_email_to = "email@email.com";
> $pfw_message = "Visitor's IP: $pfw_ip\n"
> . "name: $first_name . ' '.$last_name\n"
> . "company: $company\n"
> . "phone: $phone\n"
> . "email: $email\n"
> . "url: $url\n"
> . "comments: $comments\n"
>
> @mail($pfw_email_to, $pfw_subject ,$pfw_message ,$pfw_header ) ;
>
> echo("Thank
> you for your submission, we will respond shortly!
");
> echo "Thank you $first_name for your request
";
> echo "We have the following information from you.
";?>
>
>
> echo "First Name $first_name
";
> echo "Last Name: $last_name
";
> echo "Company Name: $company
";
> echo "Phone Number: $phone
";
> echo "Web Address: $url
";
> echo "Email Address: $email.
";?>
>
>
> echo "Your Comment: $comments
";
> ?>
>
>
> echo 'Please review your information and feel free to correct any that may
> be incorrect.
';?>
>
>
> echo 'We will contact your shortly!';
> ?>
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Solution: [PHP] Fatal error: Call to undefined function:mysqli_connect() in
am 29.12.2009 11:02:27 von chris_brech
After trying everything everyone said in here, I finally had a clear enough head to read through my logs and both my Apache httpd.conf and my PHP6 php.ini files. I realized that in my Apache error log, it was listing the fact that PHP could not load the modules for mysqli and xmlrpc (or something like that, but the focus here is MySQL).
Instead of reinstalling everything, as I'm a stubborn person, I found a line in the php.ini file that in our case probably should not be commented out.
; Directory in which the loadable extensions (modules) reside.
; http://php.net/extension-dir
; extension_dir = "./"
; On windows:
; extension_dir = "ext"
That last line (for Windows), remove the semi-colon (;), and make sure the mysqli modules you need are in C:\php\ext, after doing this, my MySQL was finally able to connect with PHP.
As a final note, Apache was telling me it was looking for the missing modules in C:\php6\ which is not a setting I ever set, and that directory does not exist in the php.ini or apache configuration files, so it seems to be a default directory for PHP. I did not see any benefit for cause for having an extra php.ini in a C:\php6 folder as some have suggested, so I would suggest trying to avoid that unless it turns out to be necessary.
Also, some people recommended putting the required modules in multiple directories, whereas I would recommend ensuring that the original installation modules are left where they are, and if you are to make copies, try to make sure all your modules are the same versions, and that you only make additional copies to the C:\php\ext folder or Apache's own includes folder if necessary. Do not make extra copies to C:\php6 or your system32 folders - this will add clutter, and possibly cause issues in the future.
I hope this helped. Just stay calm, be patient, relax - you will find the issue as long as you're clear minded and resist frustration. Have a great day.
PS: I registered just so I could share this, lol.
--
This message was sent on behalf of chris_brech@hotmail.com at openSubscriber.com
http://www.opensubscriber.com/message/php-general@lists.php. net/11675992.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php