470,619 Members | 1,450 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,619 developers. It's quick & easy.

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 2101
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 discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by jwl | last post: by
reply views Thread by Atif | last post: by
1 post views Thread by Paul Lautman | last post: by
3 posts views Thread by drblitzkrieg | last post: by
1 post views Thread by vincedav31 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.