473,324 Members | 2,166 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,324 software developers and data experts.

working with mysql

I have installed php on my server and can get the phpinfo page to display.
I have installed mysql 5 and I'm able to get into the database and create
data. I would like to be able to get php to pull the data. I have been
reading on the internet as to what I need to do in php and have created a
couple of pages. When I go to the page all I get is a blank screen - no
data from the database.

I edited my php.ini file to allow for mysql. I copied libmysql.dll to my
c:\windows\system32 directory. Is there anything else that I need to do to
make mysql and php work together?

Will
Jul 5 '06 #1
13 1527
On Wed, 05 Jul 2006 13:06:17 -0400, Auddog <wi****@hotmail.comwrote:
I have installed php on my server and can get the phpinfo page to
display.
I have installed mysql 5 and I'm able to get into the database and create
data. I would like to be able to get php to pull the data. I have been
reading on the internet as to what I need to do in php and have created a
couple of pages. When I go to the page all I get is a blank screen - no
data from the database.
When I get a blank page, it tells me that I can go look in my apache error
log for some direction on the problem to solve.

I found it helpful to echo my sql queries to screen, then copy and paste
that query into phpadmin and run it from there. In that way, I could
separate my php errors from my sql errors from my html errors, etc.

Jim
Jul 5 '06 #2
*** Auddog escribió/wrote (Wed, 05 Jul 2006 17:06:17 GMT):
couple of pages. When I go to the page all I get is a blank screen - no
data from the database.
Enable error reporting in PHP. You can do it in php.ini or in a per-script
basis:

<?php

error_reporting(E_ALL);

?>
--
-+ http://alvaro.es - Álvaro G. Vicario - Burgos, Spain
++ Mi sitio sobre programación web: http://bits.demogracia.com
+- Mi web de humor con rayos UVA: http://www.demogracia.com
--
Jul 5 '06 #3
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Auddog wrote:
I edited my php.ini file to allow for mysql. I copied libmysql.dll to my
c:\windows\system32 directory.
Check that loading of the mysql library works - what does phpinfo() say
about it?

- --
- ----------------------------------
Iván Sánchez Ortega -i-punto-sanchez--arroba-mirame-punto-net

La ciudad (polis) es una de las cosas que existen por naturaleza; y el
hombre es, por naturaleza, un animal político.
-- Aristóteles. (384-322 A.C.) Filósofo griego.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)

iD8DBQFEq/7A3jcQ2mg3Pc8RAs9yAJ9Ed1IoSW1X88aEvokaLNfkGY3aWACe IRlB
8IvTr68WwWku5sfDUDR8cxU=
=lVcb
-----END PGP SIGNATURE-----
Jul 6 '06 #4
If Windows you've installed, please make a folder tmp, like: c:\\tmp.

Auddog wrote:
I have installed php on my server and can get the phpinfo page to display.
I have installed mysql 5 and I'm able to get into the database and create
data. I would like to be able to get php to pull the data. I have been
reading on the internet as to what I need to do in php and have created a
couple of pages. When I go to the page all I get is a blank screen - no
data from the database.

I edited my php.ini file to allow for mysql. I copied libmysql.dll to my
c:\windows\system32 directory. Is there anything else that I need to do to
make mysql and php work together?

Will
Jul 6 '06 #5
I have tried all of the options listed and I have even tried this code

<?php

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','passwor d','pppe')){
throw new Exception('Error connecting to host.
'.mysqli_connect_error());
}
error_reporting(E_ALL);

// display host information
echo 'Host information: '.mysqli_get_host_info($db);
// close connection
mysqli_close($db);

?>

I still get nothing but a blank page

<ta************@gmail.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
If Windows you've installed, please make a folder tmp, like: c:\\tmp.

Auddog wrote:
>I have installed php on my server and can get the phpinfo page to
display.
I have installed mysql 5 and I'm able to get into the database and create
data. I would like to be able to get php to pull the data. I have been
reading on the internet as to what I need to do in php and have created a
couple of pages. When I go to the page all I get is a blank screen - no
data from the database.

I edited my php.ini file to allow for mysql. I copied libmysql.dll to my
c:\windows\system32 directory. Is there anything else that I need to do
to
make mysql and php work together?

Will

Jul 6 '06 #6
Auddog wrote:
I have tried all of the options listed and I have even tried this code

<?php

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','passwor d','pppe')){
throw new Exception('Error connecting to host.
'.mysqli_connect_error());
}
error_reporting(E_ALL);

// display host information
echo 'Host information: '.mysqli_get_host_info($db);
// close connection
mysqli_close($db);

?>

I still get nothing but a blank page

<ta************@gmail.comwrote in message
news:11**********************@b68g2000cwa.googlegr oups.com...
>>If Windows you've installed, please make a folder tmp, like: c:\\tmp.

Auddog wrote:
>>>I have installed php on my server and can get the phpinfo page to
display.
I have installed mysql 5 and I'm able to get into the database and create
data. I would like to be able to get php to pull the data. I have been
reading on the internet as to what I need to do in php and have created a
couple of pages. When I go to the page all I get is a blank screen - no
data from the database.

I edited my php.ini file to allow for mysql. I copied libmysql.dll to my
c:\windows\system32 directory. Is there anything else that I need to do
to
make mysql and php work together?

Will


If you get an error, you're throwing an exception but not catching it.

Rather, try:

error_reporting(E_ALL);
if(!$db=mysqli_connect('localhost','root','passwor d','pppe')){
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
.... rest of code

(P.S. Please don't top post. Thanks.).

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 6 '06 #7
thanks, I should've known to place that at the top.

That being said, I still get nothing but a blank page

A

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:IK******************************@comcast.com. ..
Auddog wrote:
>I have tried all of the options listed and I have even tried this code

<?php

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','passwo rd','pppe')){
throw new Exception('Error connecting to host.
'.mysqli_connect_error());
}
error_reporting(E_ALL);

// display host information
echo 'Host information: '.mysqli_get_host_info($db);
// close connection
mysqli_close($db);

?>

I still get nothing but a blank page

<ta************@gmail.comwrote in message
news:11**********************@b68g2000cwa.googleg roups.com...
>>>If Windows you've installed, please make a folder tmp, like: c:\\tmp.

Auddog wrote:

I have installed php on my server and can get the phpinfo page to
display.
I have installed mysql 5 and I'm able to get into the database and
create
data. I would like to be able to get php to pull the data. I have been
reading on the internet as to what I need to do in php and have created
a
couple of pages. When I go to the page all I get is a blank screen - no
data from the database.

I edited my php.ini file to allow for mysql. I copied libmysql.dll to
my
c:\windows\system32 directory. Is there anything else that I need to do
to
make mysql and php work together?

Will



If you get an error, you're throwing an exception but not catching it.

Rather, try:

error_reporting(E_ALL);
if(!$db=mysqli_connect('localhost','root','passwor d','pppe')){
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
... rest of code

(P.S. Please don't top post. Thanks.).

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

Jul 6 '06 #8
Auddog wrote:
thanks, I should've known to place that at the top.

That being said, I still get nothing but a blank page

A

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:IK******************************@comcast.com. ..
>>Auddog wrote:
>>>I have tried all of the options listed and I have even tried this code

<?php

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','pass word','pppe')){
throw new Exception('Error connecting to host.
'.mysqli_connect_error());
}
error_reporting(E_ALL);

// display host information
echo 'Host information: '.mysqli_get_host_info($db);
// close connection
mysqli_close($db);

?>

I still get nothing but a blank page

<ta************@gmail.comwrote in message
news:11**********************@b68g2000cwa.googl egroups.com...
If Windows you've installed, please make a folder tmp, like: c:\\tmp.

Auddog wrote:
>I have installed php on my server and can get the phpinfo page to
>display.
>I have installed mysql 5 and I'm able to get into the database and
>create
>data. I would like to be able to get php to pull the data. I have been
>reading on the internet as to what I need to do in php and have created
>a
>couple of pages. When I go to the page all I get is a blank screen - no
>data from the database.
>
>I edited my php.ini file to allow for mysql. I copied libmysql.dll to
>my
>c:\windows\system32 directory. Is there anything else that I need to do
>to
>make mysql and php work together?
>
>Will
If you get an error, you're throwing an exception but not catching it.

Rather, try:

error_reporting(E_ALL);
if(!$db=mysqli_connect('localhost','root','passw ord','pppe')){
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
... rest of code

(P.S. Please don't top post. Thanks.).
Again, please don't top post. This newsgroup uses bottom posting as a
standard.

Did you take out your throw statement and put in the echo like I asked?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 6 '06 #9

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:AY******************************@comcast.com. ..
Auddog wrote:
>thanks, I should've known to place that at the top.

That being said, I still get nothing but a blank page

A

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:IK******************************@comcast.com ...
>>>Auddog wrote:

I have tried all of the options listed and I have even tried this code

<?php

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','pas sword','pppe')){
throw new Exception('Error connecting to host.
'.mysqli_connect_error());
}
error_reporting(E_ALL);

// display host information
echo 'Host information: '.mysqli_get_host_info($db);
// close connection
mysqli_close($db);

?>

I still get nothing but a blank page

<ta************@gmail.comwrote in message
news:11**********************@b68g2000cwa.goog legroups.com...
>If Windows you've installed, please make a folder tmp, like: c:\\tmp.
>
>Auddog wrote:
>
>
>>I have installed php on my server and can get the phpinfo page to
>>display.
>>I have installed mysql 5 and I'm able to get into the database and
>>create
>>data. I would like to be able to get php to pull the data. I have
>>been
>>reading on the internet as to what I need to do in php and have
>>created a
>>couple of pages. When I go to the page all I get is a blank screen -
>>no
>>data from the database.
>>
>>I edited my php.ini file to allow for mysql. I copied libmysql.dll to
>>my
>>c:\windows\system32 directory. Is there anything else that I need to
>>do to
>>make mysql and php work together?
>>
>>Will

If you get an error, you're throwing an exception but not catching it.

Rather, try:

error_reporting(E_ALL);
if(!$db=mysqli_connect('localhost','root','pass word','pppe')){
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
... rest of code

(P.S. Please don't top post. Thanks.).

Again, please don't top post. This newsgroup uses bottom posting as a
standard.

Did you take out your throw statement and put in the echo like I asked?

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

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Host Information</title>
</head>
<body>

<?php
error_reporting(E_ALL);

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','passwor d','ppe'))
{
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
// display host information
echo 'Host information: '.mysqli_get_host_info($db);

// close connection
mysqli_close($db);

?>
</body>
</html>

Here's something else that I find odd. If I change the title to the web
page and save, when I bring up the page, I does not reflect the change. I
just can't figure out what is wrong.

A

ps - sorry about the top posts
Jul 6 '06 #10
Auddog wrote:
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:AY******************************@comcast.com. ..
>>Auddog wrote:
>>>thanks, I should've known to place that at the top.

That being said, I still get nothing but a blank page

A

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:IK******************************@comcast.c om...
Auddog wrote:
>I have tried all of the options listed and I have even tried this code
>
><?php
>
>// example using procedural approach
>if(!$db=mysqli_connect('localhost','root','pa ssword','pppe')){
throw new Exception('Error connecting to host.
>'.mysqli_connect_error());
>}
>error_reporting(E_ALL);
>
>// display host information
>echo 'Host information: '.mysqli_get_host_info($db);
>// close connection
>mysqli_close($db);
>
>?>
>
>I still get nothing but a blank page
>
><ta************@gmail.comwrote in message
>news:11**********************@b68g2000cwa.goo glegroups.com...
>
>
>
>>If Windows you've installed, please make a folder tmp, like: c:\\tmp.
>>
>>Auddog wrote:
>>
>>
>>
>>>I have installed php on my server and can get the phpinfo page to
>>>display.
>>>I have installed mysql 5 and I'm able to get into the database and
>>>create
>>>data. I would like to be able to get php to pull the data. I have
>>>been
>>>reading on the internet as to what I need to do in php and have
>>>created a
>>>couple of pages. When I go to the page all I get is a blank screen -
>>>no
>>>data from the database.
>>>
>>>I edited my php.ini file to allow for mysql. I copied libmysql.dll to
>>>my
>>>c:\windows\system32 directory. Is there anything else that I need to
>>>do to
>>>make mysql and php work together?
>>>
>>>Will
>
>
>
If you get an error, you're throwing an exception but not catching it.

Rather, try:

error_reporting(E_ALL);
if(!$db=mysqli_connect('localhost','root','pas sword','pppe')){
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
... rest of code

(P.S. Please don't top post. Thanks.).

Again, please don't top post. This newsgroup uses bottom posting as a
standard.

Did you take out your throw statement and put in the echo like I asked?

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


Here is my entire code:

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Host Information</title>
</head>
<body>

<?php
error_reporting(E_ALL);

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','passwor d','ppe'))
{
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
// display host information
echo 'Host information: '.mysqli_get_host_info($db);

// close connection
mysqli_close($db);

?>
</body>
</html>

Here's something else that I find odd. If I change the title to the web
page and save, when I bring up the page, I does not reflect the change. I
just can't figure out what is wrong.

A

ps - sorry about the top posts

OK, that's important. It means either you're loading the wrong page, or
the page is being cached - either by your browser or somewhere along the
line.

Try renaming your file to something you haven't used before and see what
happens. Also try clearing the cache in your browser.

And thanks for bottom posting!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 6 '06 #11

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:7-******************************@comcast.com...
Auddog wrote:
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:AY******************************@comcast.com ...
>>>Auddog wrote:

thanks, I should've known to place that at the top.

That being said, I still get nothing but a blank page

A

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:IK******************************@comcast. com...
>Auddog wrote:
>
>
>>I have tried all of the options listed and I have even tried this code
>>
>><?php
>>
>>// example using procedural approach
>>if(!$db=mysqli_connect('localhost','root','p assword','pppe')){
> throw new Exception('Error connecting to host.
>>'.mysqli_connect_error());
>>}
>>error_reporting(E_ALL);
>>
>>// display host information
>>echo 'Host information: '.mysqli_get_host_info($db);
>>// close connection
>>mysqli_close($db);
>>
>>?>
>>
>>I still get nothing but a blank page
>>
>><ta************@gmail.comwrote in message
>>news:11**********************@b68g2000cwa.go oglegroups.com...
>>
>>
>>
>>>If Windows you've installed, please make a folder tmp, like: c:\\tmp.
>>>
>>>Auddog wrote:
>>>
>>>
>>>
>>>>I have installed php on my server and can get the phpinfo page to
>>>>display.
>>>>I have installed mysql 5 and I'm able to get into the database and
>>>>create
>>>>data. I would like to be able to get php to pull the data. I have
>>>>been
>>>>reading on the internet as to what I need to do in php and have
>>>>created a
>>>>couple of pages. When I go to the page all I get is a blank
>>>>screen - no
>>>>data from the database.
>>>>
>>>>I edited my php.ini file to allow for mysql. I copied libmysql.dll
>>>>to my
>>>>c:\windows\system32 directory. Is there anything else that I need
>>>>to do to
>>>>make mysql and php work together?
>>>>
>>>>Will
>>
>>
>>
>If you get an error, you're throwing an exception but not catching it.
>
>Rather, try:
>
>error_reporting(E_ALL);
>if(!$db=mysqli_connect('localhost','root','pa ssword','pppe')){
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
>}
>... rest of code
>
>(P.S. Please don't top post. Thanks.).
>

Again, please don't top post. This newsgroup uses bottom posting as a
standard.

Did you take out your throw statement and put in the echo like I asked?

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


Here is my entire code:

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Host Information</title>
</head>
<body>

<?php
error_reporting(E_ALL);

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','passwo rd','ppe'))
{
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
// display host information
echo 'Host information: '.mysqli_get_host_info($db);

// close connection
mysqli_close($db);

?>
</body>
</html>

Here's something else that I find odd. If I change the title to the web
page and save, when I bring up the page, I does not reflect the change.
I just can't figure out what is wrong.

A

ps - sorry about the top posts


OK, that's important. It means either you're loading the wrong page, or
the page is being cached - either by your browser or somewhere along the
line.

Try renaming your file to something you haven't used before and see what
happens. Also try clearing the cache in your browser.

And thanks for bottom posting!

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
When I rename the file it doesn't load the title in either IE6 or firefox.
If I delete all the files and history in IE6, I still have the same problem.
Did I miss something in the ini file or might have I not copied all the
files to the correct location?

A
Jul 6 '06 #12

"Auddog" <wi****@hotmail.comwrote in message
news:Xx*******************@tornado.rdc-kc.rr.com...
>
"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:7-******************************@comcast.com...
>Auddog wrote:
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:AY******************************@comcast.co m...

Auddog wrote:

>thanks, I should've known to place that at the top.
>
>That being said, I still get nothing but a blank page
>
>A
>
>
>
>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>news:IK******************************@comcast .com...
>
>
>>Auddog wrote:
>>
>>
>>>I have tried all of the options listed and I have even tried this
>>>code
>>>
>>><?php
>>>
>>>// example using procedural approach
>>>if(!$db=mysqli_connect('localhost','root',' password','pppe')){
>> throw new Exception('Error connecting to host.
>>>'.mysqli_connect_error());
>>>}
>>>error_reporting(E_ALL);
>>>
>>>// display host information
>>>echo 'Host information: '.mysqli_get_host_info($db);
>>>// close connection
>>>mysqli_close($db);
>>>
>>>?>
>>>
>>>I still get nothing but a blank page
>>>
>>><ta************@gmail.comwrote in message
>>>news:11**********************@b68g2000cwa.g ooglegroups.com...
>>>
>>>
>>>
>>>>If Windows you've installed, please make a folder tmp, like:
>>>>c:\\tmp.
>>>>
>>>>Auddog wrote:
>>>>
>>>>
>>>>
>>>>>I have installed php on my server and can get the phpinfo page to
>>>>>display.
>>>>>I have installed mysql 5 and I'm able to get into the database and
>>>>>create
>>>>>data. I would like to be able to get php to pull the data. I have
>>>>>been
>>>>>reading on the internet as to what I need to do in php and have
>>>>>created a
>>>>>couple of pages. When I go to the page all I get is a blank
>>>>>screen - no
>>>>>data from the database.
>>>>>
>>>>>I edited my php.ini file to allow for mysql. I copied libmysql.dll
>>>>>to my
>>>>>c:\windows\system32 directory. Is there anything else that I need
>>>>>to do to
>>>>>make mysql and php work together?
>>>>>
>>>>>Will
>>>
>>>
>>>
>>If you get an error, you're throwing an exception but not catching it.
>>
>>Rather, try:
>>
>>error_reporting(E_ALL);
>>if(!$db=mysqli_connect('localhost','root','p assword','pppe')){
>echo 'Error connecting to host. '.mysqli_connect_error());
>exit();
>>}
>>... rest of code
>>
>>(P.S. Please don't top post. Thanks.).
>>

Again, please don't top post. This newsgroup uses bottom posting as a
standard.

Did you take out your throw statement and put in the echo like I asked?

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

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Host Information</title>
</head>
<body>

<?php
error_reporting(E_ALL);

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','passw ord','ppe'))
{
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
// display host information
echo 'Host information: '.mysqli_get_host_info($db);

// close connection
mysqli_close($db);

?>
</body>
</html>

Here's something else that I find odd. If I change the title to the web
page and save, when I bring up the page, I does not reflect the change.
I just can't figure out what is wrong.

A

ps - sorry about the top posts


OK, that's important. It means either you're loading the wrong page, or
the page is being cached - either by your browser or somewhere along the
line.

Try renaming your file to something you haven't used before and see what
happens. Also try clearing the cache in your browser.

And thanks for bottom posting!

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

When I rename the file it doesn't load the title in either IE6 or firefox.
If I delete all the files and history in IE6, I still have the same
problem. Did I miss something in the ini file or might have I not copied
all the files to the correct location?

A
It has to be something to do with the database connectivity as I can create
different php pages, make changes and have it display without problems.

A
Jul 6 '06 #13
Auddog wrote:
"Auddog" <wi****@hotmail.comwrote in message
news:Xx*******************@tornado.rdc-kc.rr.com...
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:7-******************************@comcast.com...
>>>Auddog wrote:

"Jerry Stuckle" <js*******@attglobal.netwrote in message
news:AY******************************@comcast. com...
>Auddog wrote:
>
>
>>thanks, I should've known to place that at the top.
>>
>>That being said, I still get nothing but a blank page
>>
>>A
>>
>>
>>
>>"Jerry Stuckle" <js*******@attglobal.netwrote in message
>>news:IK******************************@comcas t.com...
>>
>>
>>
>>>Auddog wrote:
>>>
>>>
>>>
>>>>I have tried all of the options listed and I have even tried this
>>>>code
>>>>
>>>><?php
>>>>
>>>>// example using procedural approach
>>>>if(!$db=mysqli_connect('localhost','root', 'password','pppe')){
>>> throw new Exception('Error connecting to host.
>>>>'.mysqli_connect_error());
>>>>}
>>>>error_reporting(E_ALL);
>>>>
>>>>// display host information
>>>>echo 'Host information: '.mysqli_get_host_info($db);
>>>>// close connection
>>>>mysqli_close($db);
>>>>
>>>>?>
>>>>
>>>>I still get nothing but a blank page
>>>>
>>>><ta************@gmail.comwrote in message
>>>>news:11**********************@b68g2000cwa. googlegroups.com...
>>>>
>>>>
>>>>
>>>>
>>>>>If Windows you've installed, please make a folder tmp, like:
>>>>>c:\\tmp.
>>>>>
>>>>>Auddog wrote:
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>I have installed php on my server and can get the phpinfo page to
>>>>>>display.
>>>>>>I have installed mysql 5 and I'm able to get into the database and
>>>>>>create
>>>>>>data. I would like to be able to get php to pull the data. I have
>>>>>>been
>>>>>>reading on the internet as to what I need to do in php and have
>>>>>>created a
>>>>>>couple of pages. When I go to the page all I get is a blank
>>>>>>screen - no
>>>>>>data from the database.
>>>>>>
>>>>>>I edited my php.ini file to allow for mysql. I copied libmysql.dll
>>>>>>to my
>>>>>>c:\windows\system32 directory. Is there anything else that I need
>>>>>>to do to
>>>>>>make mysql and php work together?
>>>>>>
>>>>>>Will
>>>>
>>>>
>>>>
>>>If you get an error, you're throwing an exception but not catching it.
>>>
>>>Rather, try:
>>>
>>>error_reporting(E_ALL);
>>>if(!$db=mysqli_connect('localhost','root',' password','pppe')){
>>>echo 'Error connecting to host. '.mysqli_connect_error());
>>>exit();
>>>}
>>>... rest of code
>>>
>>>(P.S. Please don't top post. Thanks.).
>>>
>
>Again, please don't top post. This newsgroup uses bottom posting as a
>standard.
>
>Did you take out your throw statement and put in the echo like I asked?
>
>--
>==================
>Remove the "x" from my email address
>Jerry Stuckle
>JDS Computer Training Corp.
>js*******@attglobal.net
>==================
Here is my entire code:

<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Host Information</title>
</head>
<body>

<?php
error_reporting(E_ALL);

// example using procedural approach
if(!$db=mysqli_connect('localhost','root','pas sword','ppe'))
{
echo 'Error connecting to host. '.mysqli_connect_error());
exit();
}
// display host information
echo 'Host information: '.mysqli_get_host_info($db);

// close connection
mysqli_close($db);

?>
</body>
</html>

Here's something else that I find odd. If I change the title to the web
page and save, when I bring up the page, I does not reflect the change.
I just can't figure out what is wrong.

A

ps - sorry about the top posts

OK, that's important. It means either you're loading the wrong page, or
the page is being cached - either by your browser or somewhere along the
line.

Try renaming your file to something you haven't used before and see what
happens. Also try clearing the cache in your browser.

And thanks for bottom posting!

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

When I rename the file it doesn't load the title in either IE6 or firefox.
If I delete all the files and history in IE6, I still have the same
problem. Did I miss something in the ini file or might have I not copied
all the files to the correct location?

A


It has to be something to do with the database connectivity as I can create
different php pages, make changes and have it display without problems.

A

No, it wouldn't have anything to do directly with database connectivity
- I suspect you have a problem in your code. Are you sure you have the
mysqli extensions loaded? Are there any messages in your error log?

Something else I just thought about - what's the value of display_errors
in your php.ini file? It needs to be on to get errors (such as missing
functions) to display in your browser.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jul 6 '06 #14

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

Similar topics

0
by: Morten Gulbrandsen | last post by:
Database mysql running on localhost Error The additional Features for working with linked Tables have been deactivated. To find out why click here. -> Database mysql running on localhost ...
0
by: Lekeas GK | last post by:
Hi All, I am managing a small database and some of the tables need to be strings of an average length of about 2,000 characters. I decided to use the text datatype to store this information...
0
by: Hans Maurer | last post by:
>Description: We're running our current TTS application with MySQL (on Unix). All database, table and column names are in lower-case. However, we need to access this database with a new...
5
by: Andrew DeFaria | last post by:
I created the following .sql file to demonstrate a problem I'm having. According to the manual: If |ON DELETE CASCADE| is specified, and a row in the parent table is deleted, then InnoDB...
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 ----------------------- Should I expect to be able to connect to MySQL5.0 alpha with JDBC?...
5
by: HydroSan | last post by:
Having a bit of a problem getting UPDATE working. The project in question is a simple MySQL VB.NET frontend, allowing Insertion, Selection, and others. Well, I've gotten Drop and Insert working,...
7
by: Paul | last post by:
I recently installed php 4.4.4 using windows binaries on Windows XP Pro. I also installed MySQL 4.1. I usually use Pear DB but I tried MDB2 and it worked fine until a client uses a different...
1
by: Paul | last post by:
I recently upgraded from MySQL 3.23 to 4.1. Now db is not working properly. I'd very much like your help in solving this issue! Here's the code I used to test it: require_once 'DB.php'; $db...
0
by: beary | last post by:
After months of using mysql, i decided i should have it on my local machine to make testing easier. So I downloaded and installed the latest version from the mysql site (mysql-5.0.37-win32.zip). It...
31
by: ajos | last post by:
hi frnds, i have a form,which has 2 input text boxes, the values are entering the text boxes,when i leave the 2 text boxes blank and hit submit a java script gives the message that the 2 fields are...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.