473,402 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,402 software developers and data experts.

MySQL connect failure

I have the following code

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;

@ $db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

The first echo is executed but the second is not. I have ran the very same
parameters from the command line using:

mysql -h localhost -u Fred -p

Then

use house

and I connect to the house database.

I tried this in both IE 7 and Firefox with the same results.

I'm new to this stuff so all help will be appreciated.

Thanks..


Mar 19 '07 #1
18 2215
Get rid of the @ in front of the $db = new mysqli( ...

That is suppressing any errors on that line of code. Then it should
show you in your browser what the error is and then we can help you
further.

Also, you can include $Database as the 4th parameter in your mysqli
constructor to connect to that specific database.

Mar 19 '07 #2

"Jeff" <je**@quixion.netwrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
Get rid of the @ in front of the $db = new mysqli( ...

That is suppressing any errors on that line of code. Then it should
show you in your browser what the error is and then we can help you
further.

Also, you can include $Database as the 4th parameter in your mysqli
constructor to connect to that specific database.
Okay, I now have

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;

$db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

I didn't add the database to the mysqli parameter list.

I still never got to the 2nd echo statement. Firefox gives me a "done" in
the lower left corner. The "mysqli" is the very first MySQL command I
execute in my program. Do I need "Create" or "instantiate" something first?
I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm not sure
what version. How can I find out?]

Mar 20 '07 #3
Bruce A. Julseth wrote:
"Jeff" <je**@quixion.netwrote in message
news:11**********************@p15g2000hsd.googlegr oups.com...
>Get rid of the @ in front of the $db = new mysqli( ...

That is suppressing any errors on that line of code. Then it should
show you in your browser what the error is and then we can help you
further.

Also, you can include $Database as the 4th parameter in your mysqli
constructor to connect to that specific database.

Okay, I now have

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;

$db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

I didn't add the database to the mysqli parameter list.

I still never got to the 2nd echo statement. Firefox gives me a "done" in
the lower left corner. The "mysqli" is the very first MySQL command I
execute in my program. Do I need "Create" or "instantiate" something first?
I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm not sure
what version. How can I find out?]
Add this to the beginning of your script:

error_reporting(E_ALL);
ini_set("display_errors", "1");

And see what error messages you get. Or check your PHP error log (which
may be in the Apache log).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 20 '07 #4

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Ia******************************@comcast.com. ..
Bruce A. Julseth wrote:
>"Jeff" <je**@quixion.netwrote in message
news:11**********************@p15g2000hsd.googleg roups.com...
>>Get rid of the @ in front of the $db = new mysqli( ...

That is suppressing any errors on that line of code. Then it should
show you in your browser what the error is and then we can help you
further.

Also, you can include $Database as the 4th parameter in your mysqli
constructor to connect to that specific database.

Okay, I now have

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />" .
$Database;

$db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

I didn't add the database to the mysqli parameter list.

I still never got to the 2nd echo statement. Firefox gives me a "done" in
the lower left corner. The "mysqli" is the very first MySQL command I
execute in my program. Do I need "Create" or "instantiate" something
first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
not sure what version. How can I find out?]

Add this to the beginning of your script:

error_reporting(E_ALL);
ini_set("display_errors", "1");

And see what error messages you get. Or check your PHP error log (which
may be in the Apache log).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Adding the above code gave the error message:

Fatal error: Class 'mysqli' not found in
C:\Inetpub\wwwroot\SerenadeHOA\php\functions.php on line 47

This implies to me that I have a configuration problem. What should I look
for.

My php.ini is in my C:\windows directory.:
I have extension_dir = "c:/php5/ext"

What else should I check?

Thanks..
Mar 20 '07 #5
Bruce A. Julseth wrote:
>
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Ia******************************@comcast.com. ..
>Bruce A. Julseth wrote:
>>"Jeff" <je**@quixion.netwrote in message
news:11**********************@p15g2000hsd.google groups.com...
Get rid of the @ in front of the $db = new mysqli( ...

That is suppressing any errors on that line of code. Then it should
show you in your browser what the error is and then we can help you
further.

Also, you can include $Database as the 4th parameter in your mysqli
constructor to connect to that specific database.
Okay, I now have

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />"
.
$Database;

$db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

I didn't add the database to the mysqli parameter list.

I still never got to the 2nd echo statement. Firefox gives me a "done"
in the lower left corner. The "mysqli" is the very first MySQL command I
execute in my program. Do I need "Create" or "instantiate" something
first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
not sure what version. How can I find out?]

Add this to the beginning of your script:

error_reporting(E_ALL);
ini_set("display_errors", "1");

And see what error messages you get. Or check your PHP error log (which
may be in the Apache log).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Adding the above code gave the error message:

Fatal error: Class 'mysqli' not found in
C:\Inetpub\wwwroot\SerenadeHOA\php\functions.php on line 47

This implies to me that I have a configuration problem. What should I look
for.

My php.ini is in my C:\windows directory.:
I have extension_dir = "c:/php5/ext"

What else should I check?
search for mysqli in your php.ini and comment it in.
Make sure you have the file in a place where PHP looks.

Next thing to do is running phpinfo() and see if it finds and loads mysqli.

Good luck.

Regards,
Erwin Moller
>
Thanks..
Mar 20 '07 #6

"Erwin Moller"
<si******************************************@spam yourself.comwrote in
message news:45***********************@news.xs4all.nl...
Bruce A. Julseth wrote:
>>
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Ia******************************@comcast.com ...
>>Bruce A. Julseth wrote:
"Jeff" <je**@quixion.netwrote in message
news:11**********************@p15g2000hsd.googl egroups.com...
Get rid of the @ in front of the $db = new mysqli( ...
>
That is suppressing any errors on that line of code. Then it should
show you in your browser what the error is and then we can help you
further.
>
Also, you can include $Database as the 4th parameter in your mysqli
constructor to connect to that specific database.
>

Okay, I now have

$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"

echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />"
.
$Database;

$db = new mysqli($Host, $User, $Password);

echo "Connection is " . mysqli_connect_errno();

I didn't add the database to the mysqli parameter list.

I still never got to the 2nd echo statement. Firefox gives me a "done"
in the lower left corner. The "mysqli" is the very first MySQL command
I
execute in my program. Do I need "Create" or "instantiate" something
first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
not sure what version. How can I find out?]


Add this to the beginning of your script:

error_reporting(E_ALL);
ini_set("display_errors", "1");

And see what error messages you get. Or check your PHP error log (which
may be in the Apache log).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Adding the above code gave the error message:

Fatal error: Class 'mysqli' not found in
C:\Inetpub\wwwroot\SerenadeHOA\php\functions.ph p on line 47

This implies to me that I have a configuration problem. What should I
look
for.

My php.ini is in my C:\windows directory.:
I have extension_dir = "c:/php5/ext"

What else should I check?

search for mysqli in your php.ini and comment it in.
Make sure you have the file in a place where PHP looks.

Next thing to do is running phpinfo() and see if it finds and loads
mysqli.

Good luck.

Regards,
Erwin Moller
>>
Thanks..
I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
reference to mysqli. I am referencing C:\Windows\php.ini and that's the
correct directory.

Here are the mysqli settings in my php.ini.

[MySQLi]

; Maximum number of links. -1 means no limit.
mysqli.max_links = -1

; Default port number for mysqli_connect(). If unset, mysqli_connect() will
use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only
look
; at MYSQL_PORT.
mysqli.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to
this
; file will be able to reveal the password as well.
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off
Mar 20 '07 #7
Bruce A. Julseth wrote:
"Erwin Moller"
<si******************************************@spam yourself.comwrote in
message news:45***********************@news.xs4all.nl...
>Bruce A. Julseth wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Ia******************************@comcast.co m...
Bruce A. Julseth wrote:
"Jeff" <je**@quixion.netwrote in message
news:11**********************@p15g2000hsd.goog legroups.com...
>Get rid of the @ in front of the $db = new mysqli( ...
>>
>That is suppressing any errors on that line of code. Then it should
>show you in your browser what the error is and then we can help you
>further.
>>
>Also, you can include $Database as the 4th parameter in your mysqli
>constructor to connect to that specific database.
>>
Okay, I now have
>
$Host = "localhost";
$User = "Fred";
$Database = "house";
$Password = "mypw"
>
echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br />"
.
$Database;
>
$db = new mysqli($Host, $User, $Password);
>
echo "Connection is " . mysqli_connect_errno();
>
I didn't add the database to the mysqli parameter list.
>
I still never got to the 2nd echo statement. Firefox gives me a "done"
in the lower left corner. The "mysqli" is the very first MySQL command
I
execute in my program. Do I need "Create" or "instantiate" something
first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0 [I'm
not sure what version. How can I find out?]
>
>
>
Add this to the beginning of your script:

error_reporting(E_ALL);
ini_set("display_errors", "1");

And see what error messages you get. Or check your PHP error log (which
may be in the Apache log).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Adding the above code gave the error message:

Fatal error: Class 'mysqli' not found in
C:\Inetpub\wwwroot\SerenadeHOA\php\functions.p hp on line 47

This implies to me that I have a configuration problem. What should I
look
for.

My php.ini is in my C:\windows directory.:
I have extension_dir = "c:/php5/ext"

What else should I check?
search for mysqli in your php.ini and comment it in.
Make sure you have the file in a place where PHP looks.

Next thing to do is running phpinfo() and see if it finds and loads
mysqli.

Good luck.

Regards,
Erwin Moller
>>Thanks..

I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
reference to mysqli. I am referencing C:\Windows\php.ini and that's the
correct directory.

Here are the mysqli settings in my php.ini.

[MySQLi]

; Maximum number of links. -1 means no limit.
mysqli.max_links = -1

; Default port number for mysqli_connect(). If unset, mysqli_connect() will
use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only
look
; at MYSQL_PORT.
mysqli.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the built-in
; MySQL defaults.
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this file.
; *Any* user with PHP access can run 'echo get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to
this
; file will be able to reveal the password as well.
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off

Do you have ext=extension=php_mysqli.dll in your php.ini?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 20 '07 #8

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:fI******************************@comcast.com. ..
Bruce A. Julseth wrote:
>"Erwin Moller"
<si******************************************@spa myourself.comwrote in
message news:45***********************@news.xs4all.nl...
>>Bruce A. Julseth wrote:

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Ia******************************@comcast.c om...
Bruce A. Julseth wrote:
>"Jeff" <je**@quixion.netwrote in message
>news:11**********************@p15g2000hsd.goo glegroups.com...
>>Get rid of the @ in front of the $db = new mysqli( ...
>>>
>>That is suppressing any errors on that line of code. Then it should
>>show you in your browser what the error is and then we can help you
>>further.
>>>
>>Also, you can include $Database as the 4th parameter in your mysqli
>>constructor to connect to that specific database.
>>>
>Okay, I now have
>>
> $Host = "localhost";
> $User = "Fred";
> $Database = "house";
> $Password = "mypw"
>>
> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
>/>"
> .
>$Database;
>>
> $db = new mysqli($Host, $User, $Password);
>>
> echo "Connection is " . mysqli_connect_errno();
>>
>I didn't add the database to the mysqli parameter list.
>>
>I still never got to the 2nd echo statement. Firefox gives me a
>"done"
>in the lower left corner. The "mysqli" is the very first MySQL
>command I
>execute in my program. Do I need "Create" or "instantiate" something
>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
>[I'm
>not sure what version. How can I find out?]
>>
>>
>>
Add this to the beginning of your script:
>
error_reporting(E_ALL);
ini_set("display_errors", "1");
>
And see what error messages you get. Or check your PHP error log
(which
may be in the Apache log).
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Adding the above code gave the error message:

Fatal error: Class 'mysqli' not found in
C:\Inetpub\wwwroot\SerenadeHOA\php\functions.ph p on line 47

This implies to me that I have a configuration problem. What should I
look
for.

My php.ini is in my C:\windows directory.:
I have extension_dir = "c:/php5/ext"

What else should I check?
search for mysqli in your php.ini and comment it in.
Make sure you have the file in a place where PHP looks.

Next thing to do is running phpinfo() and see if it finds and loads
mysqli.

Good luck.

Regards,
Erwin Moller

Thanks..

I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
reference to mysqli. I am referencing C:\Windows\php.ini and that's the
correct directory.

Here are the mysqli settings in my php.ini.

[MySQLi]

; Maximum number of links. -1 means no limit.
mysqli.max_links = -1

; Default port number for mysqli_connect(). If unset, mysqli_connect()
will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only
look
; at MYSQL_PORT.
mysqli.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the
built-in
; MySQL defaults.
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this
file.
; *Any* user with PHP access can run 'echo
get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to
this
; file will be able to reveal the password as well.
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off

Do you have ext=extension=php_mysqli.dll in your php.ini?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
extension=php_mysqli.dll is set

extension=php_mysql.dll is also set. Should I remove that?
Mar 21 '07 #9
Bruce A. Pulse's wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:fI******************************@comcast.com. ..
>Bruce A. Julseth wrote:
>>"Erwin Moller"
<si******************************************@sp amyourself.comwrote in
message news:45***********************@news.xs4all.nl...
Bruce A. Julseth wrote:

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:Ia******************************@comcast. com...
>Bruce A. Julseth wrote:
>>"Jeff" <je**@quixion.netwrote in message
>>news:11**********************@p15g2000hsd.go oglegroups.com...
>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>
>>>That is suppressing any errors on that line of code. Then it should
>>>show you in your browser what the error is and then we can help you
>>>further.
>>>>
>>>Also, you can include $Database as the 4th parameter in your mysqli
>>>constructor to connect to that specific database.
>>>>
>>Okay, I now have
>>>
>> $Host = "localhost";
>> $User = "Fred";
>> $Database = "house";
>> $Password = "mypw"
>>>
>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
>>/>"
>> .
>>$Database;
>>>
>> $db = new mysqli($Host, $User, $Password);
>>>
>> echo "Connection is " . mysqli_connect_errno();
>>>
>>I didn't add the database to the mysqli parameter list.
>>>
>>I still never got to the 2nd echo statement. Firefox gives me a
>>"done"
>>in the lower left corner. The "mysqli" is the very first MySQL
>>command I
>>execute in my program. Do I need "Create" or "instantiate" something
>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
>>[I'm
>>not sure what version. How can I find out?]
>>>
>>>
>>>
>Add this to the beginning of your script:
>>
>error_reporting(E_ALL);
>ini_set("display_errors", "1");
>>
>And see what error messages you get. Or check your PHP error log
>(which
>may be in the Apache log).
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================
Adding the above code gave the error message:
>
Fatal error: Class 'mysqli' not found in
C:\Inetpub\wwwroot\SerenadeHOA\php\functions.p hp on line 47
>
This implies to me that I have a configuration problem. What should I
look
for.
>
My php.ini is in my C:\windows directory.:
I have extension_dir = "c:/php5/ext"
>
What else should I check?
search for mysqli in your php.ini and comment it in.
Make sure you have the file in a place where PHP looks.

Next thing to do is running phpinfo() and see if it finds and loads
mysqli.

Good luck.

Regards,
Erwin Moller

Thanks..
I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
reference to mysqli. I am referencing C:\Windows\php.ini and that's the
correct directory.

Here are the mysqli settings in my php.ini.

[MySQLi]

; Maximum number of links. -1 means no limit.
mysqli.max_links = -1

; Default port number for mysqli_connect(). If unset, mysqli_connect()
will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will only
look
; at MYSQL_PORT.
mysqli.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the
built-in
; MySQL defaults.
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this
file.
; *Any* user with PHP access can run 'echo
get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access to
this
; file will be able to reveal the password as well.
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off
Do you have ext=extension=php_mysqli.dll in your php.ini?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

extension=php_mysqli.dll is set

extension=php_mysql.dll is also set. Should I remove that?

No, it's perfectly fine to have both of them. Are you sure you're
editing the correct php.ini file? Where does phpinfo() say it's getting
it from?

Does phpinfo() show you're loading the mysql extension? If neither are
being loaded, chances are there's a problem with the location of your
libmysqlclient.dll file (probably the location). But if the mysql
extension is being loaded, then you should be able to get to the MySQL libs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 21 '07 #10

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.com. ..
Bruce A. Pulse's wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:fI******************************@comcast.com ...
>>Bruce A. Julseth wrote:
"Erwin Moller"
<si******************************************@s pamyourself.comwrote
in message news:45***********************@news.xs4all.nl...
Bruce A. Julseth wrote:
>
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>news:Ia******************************@comcast .com...
>>Bruce A. Julseth wrote:
>>>"Jeff" <je**@quixion.netwrote in message
>>>news:11**********************@p15g2000hsd.g ooglegroups.com...
>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>
>>>>That is suppressing any errors on that line of code. Then it
>>>>should
>>>>show you in your browser what the error is and then we can help
>>>>you
>>>>further.
>>>>>
>>>>Also, you can include $Database as the 4th parameter in your
>>>>mysqli
>>>>constructor to connect to that specific database.
>>>>>
>>>Okay, I now have
>>>>
>>> $Host = "localhost";
>>> $User = "Fred";
>>> $Database = "house";
>>> $Password = "mypw"
>>>>
>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
>>>/>"
>>> .
>>>$Database;
>>>>
>>> $db = new mysqli($Host, $User, $Password);
>>>>
>>> echo "Connection is " . mysqli_connect_errno();
>>>>
>>>I didn't add the database to the mysqli parameter list.
>>>>
>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>"done"
>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>command I
>>>execute in my program. Do I need "Create" or "instantiate"
>>>something
>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
>>>[I'm
>>>not sure what version. How can I find out?]
>>>>
>>>>
>>>>
>>Add this to the beginning of your script:
>>>
>>error_reporting(E_ALL);
>>ini_set("display_errors", "1");
>>>
>>And see what error messages you get. Or check your PHP error log
>>(which
>>may be in the Apache log).
>>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js*******@attglobal.net
>>==================
>Adding the above code gave the error message:
>>
>Fatal error: Class 'mysqli' not found in
>C:\Inetpub\wwwroot\SerenadeHOA\php\functions. php on line 47
>>
>This implies to me that I have a configuration problem. What should I
>look
>for.
>>
>My php.ini is in my C:\windows directory.:
>I have extension_dir = "c:/php5/ext"
>>
>What else should I check?
search for mysqli in your php.ini and comment it in.
Make sure you have the file in a place where PHP looks.
>
Next thing to do is running phpinfo() and see if it finds and loads
mysqli.
>
Good luck.
>
Regards,
Erwin Moller
>
>Thanks..
I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
reference to mysqli. I am referencing C:\Windows\php.ini and that's
the correct directory.

Here are the mysqli settings in my php.ini.

[MySQLi]

; Maximum number of links. -1 means no limit.
mysqli.max_links = -1

; Default port number for mysqli_connect(). If unset, mysqli_connect()
will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will
only look
; at MYSQL_PORT.
mysqli.default_port = 3306

; Default socket name for local MySQL connects. If empty, uses the
built-in
; MySQL defaults.
mysqli.default_socket =

; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =

; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =

; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this
file.
; *Any* user with PHP access can run 'echo
get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access
to this
; file will be able to reveal the password as well.
mysqli.default_pw =

; Allow or prevent reconnect
mysqli.reconnect = Off
Do you have ext=extension=php_mysqli.dll in your php.ini?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

extension=php_mysqli.dll is set

extension=php_mysql.dll is also set. Should I remove that?

No, it's perfectly fine to have both of them. Are you sure you're editing
the correct php.ini file? Where does phpinfo() say it's getting it from?

Does phpinfo() show you're loading the mysql extension? If neither are
being loaded, chances are there's a problem with the location of your
libmysqlclient.dll file (probably the location). But if the mysql
extension is being loaded, then you should be able to get to the MySQL
libs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
it. I have sent you a screen shot of the phpinfo.php..

Thanks

Mar 21 '07 #11
Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.com. ..
>Bruce A. Pulse's wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:fI******************************@comcast.co m...
Bruce A. Julseth wrote:
"Erwin Moller"
<si******************************************@ spamyourself.comwrote
in message news:45***********************@news.xs4all.nl...
>Bruce A. Julseth wrote:
>>
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>news:Ia******************************@comcas t.com...
>>>Bruce A. Julseth wrote:
>>>>"Jeff" <je**@quixion.netwrote in message
>>>>news:11**********************@p15g2000hsd. googlegroups.com...
>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>
>>>>>That is suppressing any errors on that line of code. Then it
>>>>>should
>>>>>show you in your browser what the error is and then we can help
>>>>>you
>>>>>further.
>>>>>>
>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>mysqli
>>>>>constructor to connect to that specific database.
>>>>>>
>>>>Okay, I now have
>>>>>
>>>> $Host = "localhost";
>>>> $User = "Fred";
>>>> $Database = "house";
>>>> $Password = "mypw"
>>>>>
>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User . "<br
>>>>/>"
>>>> .
>>>>$Database;
>>>>>
>>>> $db = new mysqli($Host, $User, $Password);
>>>>>
>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>
>>>>I didn't add the database to the mysqli parameter list.
>>>>>
>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>"done"
>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>command I
>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>something
>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
>>>>[I'm
>>>>not sure what version. How can I find out?]
>>>>>
>>>>>
>>>>>
>>>Add this to the beginning of your script:
>>>>
>>>error_reporting(E_ALL);
>>>ini_set("display_errors", "1");
>>>>
>>>And see what error messages you get. Or check your PHP error log
>>>(which
>>>may be in the Apache log).
>>>>
>>>--
>>>==================
>>>Remove the "x" from my email address
>>>Jerry Stuckle
>>>JDS Computer Training Corp.
>>>js*******@attglobal.net
>>>==================
>>Adding the above code gave the error message:
>>>
>>Fatal error: Class 'mysqli' not found in
>>C:\Inetpub\wwwroot\SerenadeHOA\php\functions .php on line 47
>>>
>>This implies to me that I have a configuration problem. What should I
>>look
>>for.
>>>
>>My php.ini is in my C:\windows directory.:
>>I have extension_dir = "c:/php5/ext"
>>>
>>What else should I check?
>search for mysqli in your php.ini and comment it in.
>Make sure you have the file in a place where PHP looks.
>>
>Next thing to do is running phpinfo() and see if it finds and loads
>mysqli.
>>
>Good luck.
>>
>Regards,
>Erwin Moller
>>
>>Thanks..
I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
reference to mysqli. I am referencing C:\Windows\php.ini and that's
the correct directory.
>
Here are the mysqli settings in my php.ini.
>
[MySQLi]
>
; Maximum number of links. -1 means no limit.
mysqli.max_links = -1
>
; Default port number for mysqli_connect(). If unset, mysqli_connect()
will use
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
; compile-time value defined MYSQL_PORT (in that order). Win32 will
only look
; at MYSQL_PORT.
mysqli.default_port = 3306
>
; Default socket name for local MySQL connects. If empty, uses the
built-in
; MySQL defaults.
mysqli.default_socket =
>
; Default host for mysql_connect() (doesn't apply in safe mode).
mysqli.default_host =
>
; Default user for mysql_connect() (doesn't apply in safe mode).
mysqli.default_user =
>
; Default password for mysqli_connect() (doesn't apply in safe mode).
; Note that this is generally a *bad* idea to store passwords in this
file.
; *Any* user with PHP access can run 'echo
get_cfg_var("mysqli.default_pw")
; and reveal this password! And of course, any users with read access
to this
; file will be able to reveal the password as well.
mysqli.default_pw =
>
; Allow or prevent reconnect
mysqli.reconnect = Off
Do you have ext=extension=php_mysqli.dll in your php.ini?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
extension=php_mysqli.dll is set

extension=php_mysql.dll is also set. Should I remove that?
No, it's perfectly fine to have both of them. Are you sure you're editing
the correct php.ini file? Where does phpinfo() say it's getting it from?

Does phpinfo() show you're loading the mysql extension? If neither are
being loaded, chances are there's a problem with the location of your
libmysqlclient.dll file (probably the location). But if the mysql
extension is being loaded, then you should be able to get to the MySQL
libs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
it. I have sent you a screen shot of the phpinfo.php..

Thanks
OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there
you'd see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 21 '07 #12

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:rJ******************************@comcast.com. ..
Bruce A. Julseth wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.com ...
>>Bruce A. Pulse's wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:fI******************************@comcast.c om...
Bruce A. Julseth wrote:
>"Erwin Moller"
><si****************************************** @spamyourself.comwrote
>in message news:45***********************@news.xs4all.nl...
>>Bruce A. Julseth wrote:
>>>
>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>news:Ia******************************@comca st.com...
>>>>Bruce A. Julseth wrote:
>>>>>"Jeff" <je**@quixion.netwrote in message
>>>>>news:11**********************@p15g2000hsd .googlegroups.com...
>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>>
>>>>>>That is suppressing any errors on that line of code. Then it
>>>>>>should
>>>>>>show you in your browser what the error is and then we can help
>>>>>>you
>>>>>>further.
>>>>>>>
>>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>>mysqli
>>>>>>constructor to connect to that specific database.
>>>>>>>
>>>>>Okay, I now have
>>>>>>
>>>>> $Host = "localhost";
>>>>> $User = "Fred";
>>>>> $Database = "house";
>>>>> $Password = "mypw"
>>>>>>
>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
>>>>>"<br />"
>>>>> .
>>>>>$Database;
>>>>>>
>>>>> $db = new mysqli($Host, $User, $Password);
>>>>>>
>>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>>
>>>>>I didn't add the database to the mysqli parameter list.
>>>>>>
>>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>>"done"
>>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>>command I
>>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>>something
>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
>>>>>[I'm
>>>>>not sure what version. How can I find out?]
>>>>>>
>>>>>>
>>>>>>
>>>>Add this to the beginning of your script:
>>>>>
>>>>error_reporting(E_ALL);
>>>>ini_set("display_errors", "1");
>>>>>
>>>>And see what error messages you get. Or check your PHP error log
>>>>(which
>>>>may be in the Apache log).
>>>>>
>>>>--
>>>>==================
>>>>Remove the "x" from my email address
>>>>Jerry Stuckle
>>>>JDS Computer Training Corp.
>>>>js*******@attglobal.net
>>>>==================
>>>Adding the above code gave the error message:
>>>>
>>>Fatal error: Class 'mysqli' not found in
>>>C:\Inetpub\wwwroot\SerenadeHOA\php\function s.php on line 47
>>>>
>>>This implies to me that I have a configuration problem. What should
>>>I look
>>>for.
>>>>
>>>My php.ini is in my C:\windows directory.:
>>>I have extension_dir = "c:/php5/ext"
>>>>
>>>What else should I check?
>>search for mysqli in your php.ini and comment it in.
>>Make sure you have the file in a place where PHP looks.
>>>
>>Next thing to do is running phpinfo() and see if it finds and loads
>>mysqli.
>>>
>>Good luck.
>>>
>>Regards,
>>Erwin Moller
>>>
>>>Thanks..
>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
>reference to mysqli. I am referencing C:\Windows\php.ini and that's
>the correct directory.
>>
>Here are the mysqli settings in my php.ini.
>>
>[MySQLi]
>>
>; Maximum number of links. -1 means no limit.
>mysqli.max_links = -1
>>
>; Default port number for mysqli_connect(). If unset,
>mysqli_connect() will use
>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
>; compile-time value defined MYSQL_PORT (in that order). Win32 will
>only look
>; at MYSQL_PORT.
>mysqli.default_port = 3306
>>
>; Default socket name for local MySQL connects. If empty, uses the
>built-in
>; MySQL defaults.
>mysqli.default_socket =
>>
>; Default host for mysql_connect() (doesn't apply in safe mode).
>mysqli.default_host =
>>
>; Default user for mysql_connect() (doesn't apply in safe mode).
>mysqli.default_user =
>>
>; Default password for mysqli_connect() (doesn't apply in safe mode).
>; Note that this is generally a *bad* idea to store passwords in this
>file.
>; *Any* user with PHP access can run 'echo
>get_cfg_var("mysqli.default_pw")
>; and reveal this password! And of course, any users with read
>access to this
>; file will be able to reveal the password as well.
>mysqli.default_pw =
>>
>; Allow or prevent reconnect
>mysqli.reconnect = Off
Do you have ext=extension=php_mysqli.dll in your php.ini?
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
extension=php_mysqli.dll is set

extension=php_mysql.dll is also set. Should I remove that?
No, it's perfectly fine to have both of them. Are you sure you're
editing the correct php.ini file? Where does phpinfo() say it's getting
it from?

Does phpinfo() show you're loading the mysql extension? If neither are
being loaded, chances are there's a problem with the location of your
libmysqlclient.dll file (probably the location). But if the mysql
extension is being loaded, then you should be able to get to the MySQL
libs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
it. I have sent you a screen shot of the phpinfo.php..

Thanks

OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there you'd
see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
C:\Program Files\MySQL\MySQL Server 5.0\bin is in my path. I went to a
command line and "Dir"'d this directory to make sure nothing hoaky and the
dir worked. libmysql.dll is in this path.

BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php as
a pdf file. Did you get it?
Mar 21 '07 #13
Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:rJ******************************@comcast.com. ..
>Bruce A. Julseth wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.co m...
Bruce A. Pulse's wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:fI******************************@comcast. com...
>Bruce A. Julseth wrote:
>>"Erwin Moller"
>><si***************************************** *@spamyourself.comwrote
>>in message news:45***********************@news.xs4all.nl...
>>>Bruce A. Julseth wrote:
>>>>
>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>news:Ia******************************@comc ast.com...
>>>>>Bruce A. Julseth wrote:
>>>>>>"Jeff" <je**@quixion.netwrote in message
>>>>>>news:11**********************@p15g2000hs d.googlegroups.com...
>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>>>
>>>>>>>That is suppressing any errors on that line of code. Then it
>>>>>>>should
>>>>>>>show you in your browser what the error is and then we can help
>>>>>>>you
>>>>>>>further.
>>>>>>>>
>>>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>>>mysqli
>>>>>>>constructor to connect to that specific database.
>>>>>>>>
>>>>>>Okay, I now have
>>>>>>>
>>>>>> $Host = "localhost";
>>>>>> $User = "Fred";
>>>>>> $Database = "house";
>>>>>> $Password = "mypw"
>>>>>>>
>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
>>>>>>"<br />"
>>>>>> .
>>>>>>$Database;
>>>>>>>
>>>>>> $db = new mysqli($Host, $User, $Password);
>>>>>>>
>>>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>>>
>>>>>>I didn't add the database to the mysqli parameter list.
>>>>>>>
>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>>>"done"
>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>>>command I
>>>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>>>something
>>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
>>>>>>[I'm
>>>>>>not sure what version. How can I find out?]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>Add this to the beginning of your script:
>>>>>>
>>>>>error_reporting(E_ALL);
>>>>>ini_set("display_errors", "1");
>>>>>>
>>>>>And see what error messages you get. Or check your PHP error log
>>>>>(which
>>>>>may be in the Apache log).
>>>>>>
>>>>>--
>>>>>==================
>>>>>Remove the "x" from my email address
>>>>>Jerry Stuckle
>>>>>JDS Computer Training Corp.
>>>>>js*******@attglobal.net
>>>>>==================
>>>>Adding the above code gave the error message:
>>>>>
>>>>Fatal error: Class 'mysqli' not found in
>>>>C:\Inetpub\wwwroot\SerenadeHOA\php\functio ns.php on line 47
>>>>>
>>>>This implies to me that I have a configuration problem. What should
>>>>I look
>>>>for.
>>>>>
>>>>My php.ini is in my C:\windows directory.:
>>>>I have extension_dir = "c:/php5/ext"
>>>>>
>>>>What else should I check?
>>>search for mysqli in your php.ini and comment it in.
>>>Make sure you have the file in a place where PHP looks.
>>>>
>>>Next thing to do is running phpinfo() and see if it finds and loads
>>>mysqli.
>>>>
>>>Good luck.
>>>>
>>>Regards,
>>>Erwin Moller
>>>>
>>>>Thanks..
>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
>>reference to mysqli. I am referencing C:\Windows\php.ini and that's
>>the correct directory.
>>>
>>Here are the mysqli settings in my php.ini.
>>>
>>[MySQLi]
>>>
>>; Maximum number of links. -1 means no limit.
>>mysqli.max_links = -1
>>>
>>; Default port number for mysqli_connect(). If unset,
>>mysqli_connect() will use
>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
>>; compile-time value defined MYSQL_PORT (in that order). Win32 will
>>only look
>>; at MYSQL_PORT.
>>mysqli.default_port = 3306
>>>
>>; Default socket name for local MySQL connects. If empty, uses the
>>built-in
>>; MySQL defaults.
>>mysqli.default_socket =
>>>
>>; Default host for mysql_connect() (doesn't apply in safe mode).
>>mysqli.default_host =
>>>
>>; Default user for mysql_connect() (doesn't apply in safe mode).
>>mysqli.default_user =
>>>
>>; Default password for mysqli_connect() (doesn't apply in safe mode).
>>; Note that this is generally a *bad* idea to store passwords in this
>>file.
>>; *Any* user with PHP access can run 'echo
>>get_cfg_var("mysqli.default_pw")
>>; and reveal this password! And of course, any users with read
>>access to this
>>; file will be able to reveal the password as well.
>>mysqli.default_pw =
>>>
>>; Allow or prevent reconnect
>>mysqli.reconnect = Off
>Do you have ext=extension=php_mysqli.dll in your php.ini?
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================
extension=php_mysqli.dll is set
>
extension=php_mysql.dll is also set. Should I remove that?
No, it's perfectly fine to have both of them. Are you sure you're
editing the correct php.ini file? Where does phpinfo() say it's getting
it from?

Does phpinfo() show you're loading the mysql extension? If neither are
being loaded, chances are there's a problem with the location of your
libmysqlclient.dll file (probably the location). But if the mysql
extension is being loaded, then you should be able to get to the MySQL
libs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
it. I have sent you a screen shot of the phpinfo.php..

Thanks
OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there you'd
see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

C:\Program Files\MySQL\MySQL Server 5.0\bin is in my path. I went to a
command line and "Dir"'d this directory to make sure nothing hoaky and the
dir worked. libmysql.dll is in this path.

BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php as
a pdf file. Did you get it?

Hi, Bruce,

I didn't look at every line - but it looks OK.

Do you have anything in your Apache error log? The way things are set,
any errors should go there.

And it's find to have both mysql and mysqli extensions enabled.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 21 '07 #14
Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:rJ******************************@comcast.com. ..
>Bruce A. Julseth wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.co m...
Bruce A. Pulse's wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:fI******************************@comcast. com...
>Bruce A. Julseth wrote:
>>"Erwin Moller"
>><si***************************************** *@spamyourself.comwrote
>>in message news:45***********************@news.xs4all.nl...
>>>Bruce A. Julseth wrote:
>>>>
>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>news:Ia******************************@comc ast.com...
>>>>>Bruce A. Julseth wrote:
>>>>>>"Jeff" <je**@quixion.netwrote in message
>>>>>>news:11**********************@p15g2000hs d.googlegroups.com...
>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>>>
>>>>>>>That is suppressing any errors on that line of code. Then it
>>>>>>>should
>>>>>>>show you in your browser what the error is and then we can help
>>>>>>>you
>>>>>>>further.
>>>>>>>>
>>>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>>>mysqli
>>>>>>>constructor to connect to that specific database.
>>>>>>>>
>>>>>>Okay, I now have
>>>>>>>
>>>>>> $Host = "localhost";
>>>>>> $User = "Fred";
>>>>>> $Database = "house";
>>>>>> $Password = "mypw"
>>>>>>>
>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
>>>>>>"<br />"
>>>>>> .
>>>>>>$Database;
>>>>>>>
>>>>>> $db = new mysqli($Host, $User, $Password);
>>>>>>>
>>>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>>>
>>>>>>I didn't add the database to the mysqli parameter list.
>>>>>>>
>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>>>"done"
>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>>>command I
>>>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>>>something
>>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server 5.0
>>>>>>[I'm
>>>>>>not sure what version. How can I find out?]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>Add this to the beginning of your script:
>>>>>>
>>>>>error_reporting(E_ALL);
>>>>>ini_set("display_errors", "1");
>>>>>>
>>>>>And see what error messages you get. Or check your PHP error log
>>>>>(which
>>>>>may be in the Apache log).
>>>>>>
>>>>>--
>>>>>==================
>>>>>Remove the "x" from my email address
>>>>>Jerry Stuckle
>>>>>JDS Computer Training Corp.
>>>>>js*******@attglobal.net
>>>>>==================
>>>>Adding the above code gave the error message:
>>>>>
>>>>Fatal error: Class 'mysqli' not found in
>>>>C:\Inetpub\wwwroot\SerenadeHOA\php\functio ns.php on line 47
>>>>>
>>>>This implies to me that I have a configuration problem. What should
>>>>I look
>>>>for.
>>>>>
>>>>My php.ini is in my C:\windows directory.:
>>>>I have extension_dir = "c:/php5/ext"
>>>>>
>>>>What else should I check?
>>>search for mysqli in your php.ini and comment it in.
>>>Make sure you have the file in a place where PHP looks.
>>>>
>>>Next thing to do is running phpinfo() and see if it finds and loads
>>>mysqli.
>>>>
>>>Good luck.
>>>>
>>>Regards,
>>>Erwin Moller
>>>>
>>>>Thanks..
>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
>>reference to mysqli. I am referencing C:\Windows\php.ini and that's
>>the correct directory.
>>>
>>Here are the mysqli settings in my php.ini.
>>>
>>[MySQLi]
>>>
>>; Maximum number of links. -1 means no limit.
>>mysqli.max_links = -1
>>>
>>; Default port number for mysqli_connect(). If unset,
>>mysqli_connect() will use
>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
>>; compile-time value defined MYSQL_PORT (in that order). Win32 will
>>only look
>>; at MYSQL_PORT.
>>mysqli.default_port = 3306
>>>
>>; Default socket name for local MySQL connects. If empty, uses the
>>built-in
>>; MySQL defaults.
>>mysqli.default_socket =
>>>
>>; Default host for mysql_connect() (doesn't apply in safe mode).
>>mysqli.default_host =
>>>
>>; Default user for mysql_connect() (doesn't apply in safe mode).
>>mysqli.default_user =
>>>
>>; Default password for mysqli_connect() (doesn't apply in safe mode).
>>; Note that this is generally a *bad* idea to store passwords in this
>>file.
>>; *Any* user with PHP access can run 'echo
>>get_cfg_var("mysqli.default_pw")
>>; and reveal this password! And of course, any users with read
>>access to this
>>; file will be able to reveal the password as well.
>>mysqli.default_pw =
>>>
>>; Allow or prevent reconnect
>>mysqli.reconnect = Off
>Do you have ext=extension=php_mysqli.dll in your php.ini?
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================
extension=php_mysqli.dll is set
>
extension=php_mysql.dll is also set. Should I remove that?
No, it's perfectly fine to have both of them. Are you sure you're
editing the correct php.ini file? Where does phpinfo() say it's getting
it from?

Does phpinfo() show you're loading the mysql extension? If neither are
being loaded, chances are there's a problem with the location of your
libmysqlclient.dll file (probably the location). But if the mysql
extension is being loaded, then you should be able to get to the MySQL
libs.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I missed
it. I have sent you a screen shot of the phpinfo.php..

Thanks
OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there you'd
see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

C:\Program Files\MySQL\MySQL Server 5.0\bin is in my path. I went to a
command line and "Dir"'d this directory to make sure nothing hoaky and the
dir worked. libmysql.dll is in this path.

BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php as
a pdf file. Did you get it?

Also, another though here, Bruce. Do you have your permissions set to
allow your Apache user to read/execute libmysql.dll?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 21 '07 #15

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:mP******************************@comcast.com. ..
Bruce A. Julseth wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:rJ******************************@comcast.com ...
>>Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.c om...
Bruce A. Pulse's wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>news:fI******************************@comcast .com...
>>Bruce A. Julseth wrote:
>>>"Erwin Moller"
>>><si**************************************** **@spamyourself.com>
>>>wrote in message news:45***********************@news.xs4all.nl...
>>>>Bruce A. Julseth wrote:
>>>>>
>>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>>news:Ia******************************@com cast.com...
>>>>>>Bruce A. Julseth wrote:
>>>>>>>"Jeff" <je**@quixion.netwrote in message
>>>>>>>news:11**********************@p15g2000h sd.googlegroups.com...
>>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>>>>
>>>>>>>>That is suppressing any errors on that line of code. Then it
>>>>>>>>should
>>>>>>>>show you in your browser what the error is and then we can
>>>>>>>>help you
>>>>>>>>further.
>>>>>>>>>
>>>>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>>>>mysqli
>>>>>>>>constructor to connect to that specific database.
>>>>>>>>>
>>>>>>>Okay, I now have
>>>>>>>>
>>>>>>> $Host = "localhost";
>>>>>>> $User = "Fred";
>>>>>>> $Database = "house";
>>>>>>> $Password = "mypw"
>>>>>>>>
>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
>>>>>>>"<br />"
>>>>>>> .
>>>>>>>$Database;
>>>>>>>>
>>>>>>> $db = new mysqli($Host, $User, $Password);
>>>>>>>>
>>>>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>>>>
>>>>>>>I didn't add the database to the mysqli parameter list.
>>>>>>>>
>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>>>>"done"
>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>>>>command I
>>>>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>>>>something
>>>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server
>>>>>>>5.0 [I'm
>>>>>>>not sure what version. How can I find out?]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>Add this to the beginning of your script:
>>>>>>>
>>>>>>error_reporting(E_ALL);
>>>>>>ini_set("display_errors", "1");
>>>>>>>
>>>>>>And see what error messages you get. Or check your PHP error
>>>>>>log (which
>>>>>>may be in the Apache log).
>>>>>>>
>>>>>>--
>>>>>>==================
>>>>>>Remove the "x" from my email address
>>>>>>Jerry Stuckle
>>>>>>JDS Computer Training Corp.
>>>>>>js*******@attglobal.net
>>>>>>==================
>>>>>Adding the above code gave the error message:
>>>>>>
>>>>>Fatal error: Class 'mysqli' not found in
>>>>>C:\Inetpub\wwwroot\SerenadeHOA\php\functi ons.php on line 47
>>>>>>
>>>>>This implies to me that I have a configuration problem. What
>>>>>should I look
>>>>>for.
>>>>>>
>>>>>My php.ini is in my C:\windows directory.:
>>>>>I have extension_dir = "c:/php5/ext"
>>>>>>
>>>>>What else should I check?
>>>>search for mysqli in your php.ini and comment it in.
>>>>Make sure you have the file in a place where PHP looks.
>>>>>
>>>>Next thing to do is running phpinfo() and see if it finds and
>>>>loads mysqli.
>>>>>
>>>>Good luck.
>>>>>
>>>>Regards,
>>>>Erwin Moller
>>>>>
>>>>>Thanks..
>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
>>>reference to mysqli. I am referencing C:\Windows\php.ini and
>>>that's the correct directory.
>>>>
>>>Here are the mysqli settings in my php.ini.
>>>>
>>>[MySQLi]
>>>>
>>>; Maximum number of links. -1 means no limit.
>>>mysqli.max_links = -1
>>>>
>>>; Default port number for mysqli_connect(). If unset,
>>>mysqli_connect() will use
>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or
>>>the
>>>; compile-time value defined MYSQL_PORT (in that order). Win32
>>>will only look
>>>; at MYSQL_PORT.
>>>mysqli.default_port = 3306
>>>>
>>>; Default socket name for local MySQL connects. If empty, uses the
>>>built-in
>>>; MySQL defaults.
>>>mysqli.default_socket =
>>>>
>>>; Default host for mysql_connect() (doesn't apply in safe mode).
>>>mysqli.default_host =
>>>>
>>>; Default user for mysql_connect() (doesn't apply in safe mode).
>>>mysqli.default_user =
>>>>
>>>; Default password for mysqli_connect() (doesn't apply in safe
>>>mode).
>>>; Note that this is generally a *bad* idea to store passwords in
>>>this file.
>>>; *Any* user with PHP access can run 'echo
>>>get_cfg_var("mysqli.default_pw")
>>>; and reveal this password! And of course, any users with read
>>>access to this
>>>; file will be able to reveal the password as well.
>>>mysqli.default_pw =
>>>>
>>>; Allow or prevent reconnect
>>>mysqli.reconnect = Off
>>Do you have ext=extension=php_mysqli.dll in your php.ini?
>>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js*******@attglobal.net
>>==================
>extension=php_mysqli.dll is set
>>
>extension=php_mysql.dll is also set. Should I remove that?
No, it's perfectly fine to have both of them. Are you sure you're
editing the correct php.ini file? Where does phpinfo() say it's
getting it from?
>
Does phpinfo() show you're loading the mysql extension? If neither
are being loaded, chances are there's a problem with the location of
your libmysqlclient.dll file (probably the location). But if the
mysql extension is being loaded, then you should be able to get to the
MySQL libs.
>
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I
missed it. I have sent you a screen shot of the phpinfo.php..

Thanks

OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there
you'd see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

C:\Program Files\MySQL\MySQL Server 5.0\bin is in my path. I went to a
command line and "Dir"'d this directory to make sure nothing hoaky and
the dir worked. libmysql.dll is in this path.

BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php
as a pdf file. Did you get it?

Also, another though here, Bruce. Do you have your permissions set to
allow your Apache user to read/execute libmysql.dll?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
I have NOTHING in Apache Conf file relating to mysql. How do give these
"permissions?"

thanks...
Mar 22 '07 #16

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:k4******************************@comcast.com. ..
Bruce A. Julseth wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:rJ******************************@comcast.com ...
>>Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.c om...
Bruce A. Pulse's wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>news:fI******************************@comcast .com...
>>Bruce A. Julseth wrote:
>>>"Erwin Moller"
>>><si**************************************** **@spamyourself.com>
>>>wrote in message news:45***********************@news.xs4all.nl...
>>>>Bruce A. Julseth wrote:
>>>>>
>>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>>news:Ia******************************@com cast.com...
>>>>>>Bruce A. Julseth wrote:
>>>>>>>"Jeff" <je**@quixion.netwrote in message
>>>>>>>news:11**********************@p15g2000h sd.googlegroups.com...
>>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>>>>
>>>>>>>>That is suppressing any errors on that line of code. Then it
>>>>>>>>should
>>>>>>>>show you in your browser what the error is and then we can
>>>>>>>>help you
>>>>>>>>further.
>>>>>>>>>
>>>>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>>>>mysqli
>>>>>>>>constructor to connect to that specific database.
>>>>>>>>>
>>>>>>>Okay, I now have
>>>>>>>>
>>>>>>> $Host = "localhost";
>>>>>>> $User = "Fred";
>>>>>>> $Database = "house";
>>>>>>> $Password = "mypw"
>>>>>>>>
>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
>>>>>>>"<br />"
>>>>>>> .
>>>>>>>$Database;
>>>>>>>>
>>>>>>> $db = new mysqli($Host, $User, $Password);
>>>>>>>>
>>>>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>>>>
>>>>>>>I didn't add the database to the mysqli parameter list.
>>>>>>>>
>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>>>>"done"
>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>>>>command I
>>>>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>>>>something
>>>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server
>>>>>>>5.0 [I'm
>>>>>>>not sure what version. How can I find out?]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>Add this to the beginning of your script:
>>>>>>>
>>>>>>error_reporting(E_ALL);
>>>>>>ini_set("display_errors", "1");
>>>>>>>
>>>>>>And see what error messages you get. Or check your PHP error
>>>>>>log (which
>>>>>>may be in the Apache log).
>>>>>>>
>>>>>>--
>>>>>>==================
>>>>>>Remove the "x" from my email address
>>>>>>Jerry Stuckle
>>>>>>JDS Computer Training Corp.
>>>>>>js*******@attglobal.net
>>>>>>==================
>>>>>Adding the above code gave the error message:
>>>>>>
>>>>>Fatal error: Class 'mysqli' not found in
>>>>>C:\Inetpub\wwwroot\SerenadeHOA\php\functi ons.php on line 47
>>>>>>
>>>>>This implies to me that I have a configuration problem. What
>>>>>should I look
>>>>>for.
>>>>>>
>>>>>My php.ini is in my C:\windows directory.:
>>>>>I have extension_dir = "c:/php5/ext"
>>>>>>
>>>>>What else should I check?
>>>>search for mysqli in your php.ini and comment it in.
>>>>Make sure you have the file in a place where PHP looks.
>>>>>
>>>>Next thing to do is running phpinfo() and see if it finds and
>>>>loads mysqli.
>>>>>
>>>>Good luck.
>>>>>
>>>>Regards,
>>>>Erwin Moller
>>>>>
>>>>>Thanks..
>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
>>>reference to mysqli. I am referencing C:\Windows\php.ini and
>>>that's the correct directory.
>>>>
>>>Here are the mysqli settings in my php.ini.
>>>>
>>>[MySQLi]
>>>>
>>>; Maximum number of links. -1 means no limit.
>>>mysqli.max_links = -1
>>>>
>>>; Default port number for mysqli_connect(). If unset,
>>>mysqli_connect() will use
>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or
>>>the
>>>; compile-time value defined MYSQL_PORT (in that order). Win32
>>>will only look
>>>; at MYSQL_PORT.
>>>mysqli.default_port = 3306
>>>>
>>>; Default socket name for local MySQL connects. If empty, uses the
>>>built-in
>>>; MySQL defaults.
>>>mysqli.default_socket =
>>>>
>>>; Default host for mysql_connect() (doesn't apply in safe mode).
>>>mysqli.default_host =
>>>>
>>>; Default user for mysql_connect() (doesn't apply in safe mode).
>>>mysqli.default_user =
>>>>
>>>; Default password for mysqli_connect() (doesn't apply in safe
>>>mode).
>>>; Note that this is generally a *bad* idea to store passwords in
>>>this file.
>>>; *Any* user with PHP access can run 'echo
>>>get_cfg_var("mysqli.default_pw")
>>>; and reveal this password! And of course, any users with read
>>>access to this
>>>; file will be able to reveal the password as well.
>>>mysqli.default_pw =
>>>>
>>>; Allow or prevent reconnect
>>>mysqli.reconnect = Off
>>Do you have ext=extension=php_mysqli.dll in your php.ini?
>>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js*******@attglobal.net
>>==================
>extension=php_mysqli.dll is set
>>
>extension=php_mysql.dll is also set. Should I remove that?
No, it's perfectly fine to have both of them. Are you sure you're
editing the correct php.ini file? Where does phpinfo() say it's
getting it from?
>
Does phpinfo() show you're loading the mysql extension? If neither
are being loaded, chances are there's a problem with the location of
your libmysqlclient.dll file (probably the location). But if the
mysql extension is being loaded, then you should be able to get to the
MySQL libs.
>
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I
missed it. I have sent you a screen shot of the phpinfo.php..

Thanks

OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there
you'd see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

C:\Program Files\MySQL\MySQL Server 5.0\bin is in my path. I went to a
command line and "Dir"'d this directory to make sure nothing hoaky and
the dir worked. libmysql.dll is in this path.

BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php
as a pdf file. Did you get it?

Hi, Bruce,

I didn't look at every line - but it looks OK.

Do you have anything in your Apache error log? The way things are set,
any errors should go there.

And it's find to have both mysql and mysqli extensions enabled.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
This is the only error in the Apache Log file:

[Wed Mar 21 22:26:17 2007] [error] [client 127.0.0.1] PHP Fatal error:
Class 'mysqli' not found in
C:\\Inetpub\\wwwroot\\SerenadeHOA\\php\\functions. php on line 47, referer:
http://localhost:8080/serenade/Reser...s/Schedule.php

Does this give me anything new?? I have a "Common" functions file that I
include in most of my PHP files.
Mar 22 '07 #17

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:mP******************************@comcast.com. ..
Bruce A. Julseth wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:rJ******************************@comcast.com ...
>>Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast.c om...
Bruce A. Pulse's wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>news:fI******************************@comcast .com...
>>Bruce A. Julseth wrote:
>>>"Erwin Moller"
>>><si**************************************** **@spamyourself.com>
>>>wrote in message news:45***********************@news.xs4all.nl...
>>>>Bruce A. Julseth wrote:
>>>>>
>>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>>news:Ia******************************@com cast.com...
>>>>>>Bruce A. Julseth wrote:
>>>>>>>"Jeff" <je**@quixion.netwrote in message
>>>>>>>news:11**********************@p15g2000h sd.googlegroups.com...
>>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>>>>
>>>>>>>>That is suppressing any errors on that line of code. Then it
>>>>>>>>should
>>>>>>>>show you in your browser what the error is and then we can
>>>>>>>>help you
>>>>>>>>further.
>>>>>>>>>
>>>>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>>>>mysqli
>>>>>>>>constructor to connect to that specific database.
>>>>>>>>>
>>>>>>>Okay, I now have
>>>>>>>>
>>>>>>> $Host = "localhost";
>>>>>>> $User = "Fred";
>>>>>>> $Database = "house";
>>>>>>> $Password = "mypw"
>>>>>>>>
>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
>>>>>>>"<br />"
>>>>>>> .
>>>>>>>$Database;
>>>>>>>>
>>>>>>> $db = new mysqli($Host, $User, $Password);
>>>>>>>>
>>>>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>>>>
>>>>>>>I didn't add the database to the mysqli parameter list.
>>>>>>>>
>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>>>>"done"
>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>>>>command I
>>>>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>>>>something
>>>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server
>>>>>>>5.0 [I'm
>>>>>>>not sure what version. How can I find out?]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>Add this to the beginning of your script:
>>>>>>>
>>>>>>error_reporting(E_ALL);
>>>>>>ini_set("display_errors", "1");
>>>>>>>
>>>>>>And see what error messages you get. Or check your PHP error
>>>>>>log (which
>>>>>>may be in the Apache log).
>>>>>>>
>>>>>>--
>>>>>>==================
>>>>>>Remove the "x" from my email address
>>>>>>Jerry Stuckle
>>>>>>JDS Computer Training Corp.
>>>>>>js*******@attglobal.net
>>>>>>==================
>>>>>Adding the above code gave the error message:
>>>>>>
>>>>>Fatal error: Class 'mysqli' not found in
>>>>>C:\Inetpub\wwwroot\SerenadeHOA\php\functi ons.php on line 47
>>>>>>
>>>>>This implies to me that I have a configuration problem. What
>>>>>should I look
>>>>>for.
>>>>>>
>>>>>My php.ini is in my C:\windows directory.:
>>>>>I have extension_dir = "c:/php5/ext"
>>>>>>
>>>>>What else should I check?
>>>>search for mysqli in your php.ini and comment it in.
>>>>Make sure you have the file in a place where PHP looks.
>>>>>
>>>>Next thing to do is running phpinfo() and see if it finds and
>>>>loads mysqli.
>>>>>
>>>>Good luck.
>>>>>
>>>>Regards,
>>>>Erwin Moller
>>>>>
>>>>>Thanks..
>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
>>>reference to mysqli. I am referencing C:\Windows\php.ini and
>>>that's the correct directory.
>>>>
>>>Here are the mysqli settings in my php.ini.
>>>>
>>>[MySQLi]
>>>>
>>>; Maximum number of links. -1 means no limit.
>>>mysqli.max_links = -1
>>>>
>>>; Default port number for mysqli_connect(). If unset,
>>>mysqli_connect() will use
>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or
>>>the
>>>; compile-time value defined MYSQL_PORT (in that order). Win32
>>>will only look
>>>; at MYSQL_PORT.
>>>mysqli.default_port = 3306
>>>>
>>>; Default socket name for local MySQL connects. If empty, uses the
>>>built-in
>>>; MySQL defaults.
>>>mysqli.default_socket =
>>>>
>>>; Default host for mysql_connect() (doesn't apply in safe mode).
>>>mysqli.default_host =
>>>>
>>>; Default user for mysql_connect() (doesn't apply in safe mode).
>>>mysqli.default_user =
>>>>
>>>; Default password for mysqli_connect() (doesn't apply in safe
>>>mode).
>>>; Note that this is generally a *bad* idea to store passwords in
>>>this file.
>>>; *Any* user with PHP access can run 'echo
>>>get_cfg_var("mysqli.default_pw")
>>>; and reveal this password! And of course, any users with read
>>>access to this
>>>; file will be able to reveal the password as well.
>>>mysqli.default_pw =
>>>>
>>>; Allow or prevent reconnect
>>>mysqli.reconnect = Off
>>Do you have ext=extension=php_mysqli.dll in your php.ini?
>>>
>>--
>>==================
>>Remove the "x" from my email address
>>Jerry Stuckle
>>JDS Computer Training Corp.
>>js*******@attglobal.net
>>==================
>extension=php_mysqli.dll is set
>>
>extension=php_mysql.dll is also set. Should I remove that?
No, it's perfectly fine to have both of them. Are you sure you're
editing the correct php.ini file? Where does phpinfo() say it's
getting it from?
>
Does phpinfo() show you're loading the mysql extension? If neither
are being loaded, chances are there's a problem with the location of
your libmysqlclient.dll file (probably the location). But if the
mysql extension is being loaded, then you should be able to get to the
MySQL libs.
>
>
>
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
php.ini is coming from C:\Windows.

Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I
missed it. I have sent you a screen shot of the phpinfo.php..

Thanks

OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there
you'd see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

C:\Program Files\MySQL\MySQL Server 5.0\bin is in my path. I went to a
command line and "Dir"'d this directory to make sure nothing hoaky and
the dir worked. libmysql.dll is in this path.

BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php
as a pdf file. Did you get it?

Also, another though here, Bruce. Do you have your permissions set to
allow your Apache user to read/execute libmysql.dll?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Well, it's working!! And, I'm not sure why!! My guess is that a change I
made earlier was the correct one but I FAILED to restart Apache.

Thanks for you help.. Since I really am just learning, I'm sure I'll be
back. But I have learned a lesson. ALWAYS restart Apache when you make
changes to php.ini and/or the apache config file.

Thanks again..

Bruce
Mar 22 '07 #18
Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:mP******************************@comcast.com. ..
>Bruce A. Julseth wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:rJ******************************@comcast.co m...
Bruce A. Julseth wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:TO******************************@comcast. com...
>Bruce A. Pulse's wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>news:fI******************************@comcas t.com...
>>>Bruce A. Julseth wrote:
>>>>"Erwin Moller"
>>>><si*************************************** ***@spamyourself.com>
>>>>wrote in message news:45***********************@news.xs4all.nl...
>>>>>Bruce A. Julseth wrote:
>>>>>>
>>>>>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>>>>>news:Ia******************************@co mcast.com...
>>>>>>>Bruce A. Julseth wrote:
>>>>>>>>"Jeff" <je**@quixion.netwrote in message
>>>>>>>>news:11**********************@p15g2000 hsd.googlegroups.com...
>>>>>>>>>Get rid of the @ in front of the $db = new mysqli( ...
>>>>>>>>>>
>>>>>>>>>That is suppressing any errors on that line of code. Then it
>>>>>>>>>should
>>>>>>>>>show you in your browser what the error is and then we can
>>>>>>>>>help you
>>>>>>>>>further.
>>>>>>>>>>
>>>>>>>>>Also, you can include $Database as the 4th parameter in your
>>>>>>>>>mysqli
>>>>>>>>>constructor to connect to that specific database.
>>>>>>>>>>
>>>>>>>>Okay, I now have
>>>>>>>>>
>>>>>>>> $Host = "localhost";
>>>>>>>> $User = "Fred";
>>>>>>>> $Database = "house";
>>>>>>>> $Password = "mypw"
>>>>>>>>>
>>>>>>>> echo "before mysqli<br />Host: " . $Host . "<br />" . $User .
>>>>>>>>"<br />"
>>>>>>>> .
>>>>>>>>$Database;
>>>>>>>>>
>>>>>>>> $db = new mysqli($Host, $User, $Password);
>>>>>>>>>
>>>>>>>> echo "Connection is " . mysqli_connect_errno();
>>>>>>>>>
>>>>>>>>I didn't add the database to the mysqli parameter list.
>>>>>>>>>
>>>>>>>>I still never got to the 2nd echo statement. Firefox gives me a
>>>>>>>>"done"
>>>>>>>>in the lower left corner. The "mysqli" is the very first MySQL
>>>>>>>>command I
>>>>>>>>execute in my program. Do I need "Create" or "instantiate"
>>>>>>>>something
>>>>>>>>first? I'm running PHP 5.2.0 (re: phpinfo()) and MySQL Server
>>>>>>>>5.0 [I'm
>>>>>>>>not sure what version. How can I find out?]
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>Add this to the beginning of your script:
>>>>>>>>
>>>>>>>error_reporting(E_ALL);
>>>>>>>ini_set("display_errors", "1");
>>>>>>>>
>>>>>>>And see what error messages you get. Or check your PHP error
>>>>>>>log (which
>>>>>>>may be in the Apache log).
>>>>>>>>
>>>>>>>--
>>>>>>>==================
>>>>>>>Remove the "x" from my email address
>>>>>>>Jerry Stuckle
>>>>>>>JDS Computer Training Corp.
>>>>>>>js*******@attglobal.net
>>>>>>>==================
>>>>>>Adding the above code gave the error message:
>>>>>>>
>>>>>>Fatal error: Class 'mysqli' not found in
>>>>>>C:\Inetpub\wwwroot\SerenadeHOA\php\funct ions.php on line 47
>>>>>>>
>>>>>>This implies to me that I have a configuration problem. What
>>>>>>should I look
>>>>>>for.
>>>>>>>
>>>>>>My php.ini is in my C:\windows directory.:
>>>>>>I have extension_dir = "c:/php5/ext"
>>>>>>>
>>>>>>What else should I check?
>>>>>search for mysqli in your php.ini and comment it in.
>>>>>Make sure you have the file in a place where PHP looks.
>>>>>>
>>>>>Next thing to do is running phpinfo() and see if it finds and
>>>>>loads mysqli.
>>>>>>
>>>>>Good luck.
>>>>>>
>>>>>Regards,
>>>>>Erwin Moller
>>>>>>
>>>>>>Thanks..
>>>>I checked my PHPInfo.php with Ctrl-F of the html code and found NOT
>>>>reference to mysqli. I am referencing C:\Windows\php.ini and
>>>>that's the correct directory.
>>>>>
>>>>Here are the mysqli settings in my php.ini.
>>>>>
>>>>[MySQLi]
>>>>>
>>>>; Maximum number of links. -1 means no limit.
>>>>mysqli.max_links = -1
>>>>>
>>>>; Default port number for mysqli_connect(). If unset,
>>>>mysqli_connect() will use
>>>>; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or
>>>>the
>>>>; compile-time value defined MYSQL_PORT (in that order). Win32
>>>>will only look
>>>>; at MYSQL_PORT.
>>>>mysqli.default_port = 3306
>>>>>
>>>>; Default socket name for local MySQL connects. If empty, uses the
>>>>built-in
>>>>; MySQL defaults.
>>>>mysqli.default_socket =
>>>>>
>>>>; Default host for mysql_connect() (doesn't apply in safe mode).
>>>>mysqli.default_host =
>>>>>
>>>>; Default user for mysql_connect() (doesn't apply in safe mode).
>>>>mysqli.default_user =
>>>>>
>>>>; Default password for mysqli_connect() (doesn't apply in safe
>>>>mode).
>>>>; Note that this is generally a *bad* idea to store passwords in
>>>>this file.
>>>>; *Any* user with PHP access can run 'echo
>>>>get_cfg_var("mysqli.default_pw")
>>>>; and reveal this password! And of course, any users with read
>>>>access to this
>>>>; file will be able to reveal the password as well.
>>>>mysqli.default_pw =
>>>>>
>>>>; Allow or prevent reconnect
>>>>mysqli.reconnect = Off
>>>Do you have ext=extension=php_mysqli.dll in your php.ini?
>>>>
>>>--
>>>==================
>>>Remove the "x" from my email address
>>>Jerry Stuckle
>>>JDS Computer Training Corp.
>>>js*******@attglobal.net
>>>==================
>>extension=php_mysqli.dll is set
>>>
>>extension=php_mysql.dll is also set. Should I remove that?
>No, it's perfectly fine to have both of them. Are you sure you're
>editing the correct php.ini file? Where does phpinfo() say it's
>getting it from?
>>
>Does phpinfo() show you're loading the mysql extension? If neither
>are being loaded, chances are there's a problem with the location of
>your libmysqlclient.dll file (probably the location). But if the
>mysql extension is being loaded, then you should be able to get to the
>MySQL libs.
>>
>>
>>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================
php.ini is coming from C:\Windows.
>
Running phpinfo.php I find NO mention of mysql anywhere. Perhaps I
missed it. I have sent you a screen shot of the phpinfo.php..
>
Thanks
>
>
>
OK, that means it isn't finding something it needs for mysql - probably
libmysql.dll. Ensure your mysql\bin directory is in your PATH or
libmysql.dll is in a directory in your PATH.

And sorry - I don't have a screen shot handy - but if it were there
you'd see it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
C:\Program Files\MySQL\MySQL Server 5.0\bin is in my path. I went to a
command line and "Dir"'d this directory to make sure nothing hoaky and
the dir worked. libmysql.dll is in this path.

BTW: I emailed you (Jerry: removing the x) my php.ini and my phpinfo.php
as a pdf file. Did you get it?
Also, another though here, Bruce. Do you have your permissions set to
allow your Apache user to read/execute libmysql.dll?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Well, it's working!! And, I'm not sure why!! My guess is that a change I
made earlier was the correct one but I FAILED to restart Apache.

Thanks for you help.. Since I really am just learning, I'm sure I'll be
back. But I have learned a lesson. ALWAYS restart Apache when you make
changes to php.ini and/or the apache config file.

Thanks again..

Bruce

Yep, I guess that's partly my fault, also. I just assumed you restarted
Apache - and didn't bother to check.

I should have known better. Glad it's working for you now.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Mar 22 '07 #19

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Robert Mazur | last post by:
MySQL 5.0 alpha (binary install) on Solaris 9 -or- RedHat 8.0 mysql-connector-java-3.0.8-stable ----------------------- Is there something different going on with JDBC and the alpha version...
0
by: jwl | last post by:
I'm having a problem with a bit of code that I have "adopted". It was partially complete when I took it over. The function of the code is to read a log file, locate files described in that log...
0
by: Atif | last post by:
Hi All My problem is not related with this group BUT i have got a clue from here that's why i am posting this question over here. I am using Crystal Reports 9 with MySQL and SQL Server....
5
by: Ike | last post by:
Through Java, I am attempting to connect to a MySQL 4.12 server on a remote computer. I can connect fine via php. I cann connect fine via Java, through a servlet, when the servlet is on the same...
1
by: Paul Lautman | last post by:
I have 2 scripts that both start with: <?php // Database Connection include 'connect.php'; One of them is fine, but the other gives the error: Warning: mysql_connect(): Can't connect to...
7
by: Ike | last post by:
Let's say I have a MySQL 4.12 database, opened to the internet on 111.111.111.111 allowing all incoming and outgoing ports. I have a username and password setup, which CAN connect to this database,...
14
by: mistral | last post by:
Need php script to create mySQL database programmatically; since hosting configuration may not allow create database from script, script also need eliminate/rewrite all restrictions in appropriate...
3
by: drblitzkrieg | last post by:
Hi, A bit of a newbie as far as mysql and php adminning I am; I upgraded php to version 4.4.6, and mysql to 4.1.22, following the instructions in the "INSTALL" files of each (I also have the...
1
by: vincedav31 | last post by:
I have a connection to a server and my database. I use it like this in my code : Class.forName("com.mysql.jdbc.Driver"); String DBurl = "jdbc:mysql://138.63.222.7:3306/ns3"; m_connection =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.