By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,961 Members | 1,320 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,961 IT Pros & Developers. It's quick & easy.

working with mysql

P: n/a
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
Share this Question
Share on Google+
13 Replies


P: n/a
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

P: n/a
*** 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

P: n/a
-----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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a

"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

P: n/a
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

P: n/a

"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

P: n/a

"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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.