Board index   FAQ   Search  
Register  Login
Board index php forum :: Database MySQL Installation

Recieving blank screen

Installation and configuration iussues

Moderators: macek, egami, gesf

Recieving blank screen

Postby someonelost » Wed Apr 06, 2005 5:31 am

8-O :eek: :help:
I'm having some problems installin PHP and MySQL on PWS.
I have instaled PHP and that seems to be working fine (i checkd it with phpinfo() ) but when I run a file to test MySQL I get a blanck screen.

First I tried this:

[PHP]<?php
mysql_connect('localhost','USERNAME','PASSWORD');
mysql_select_db('test');

echo 'unless you see any error messages, everything should be fine';
?>[/PHP]

I then went to the mysql and php for dummies website and tried this;
[PHP]
<html>
<head><title>test MySQL</title></head>
<body>
<!-- mysql_up.php -->
<?php
$host="localhost";
$user="USERNAME";
$password="PASSWORD";

mysql_connect($host,$user,$password);
$sql="show status";
$result = mysql_query($sql);
if ($result == 0)
echo "<b>Error " . mysql_errno() . ": "
. mysql_error() . "</b>";
else
{
?>
<!-- Table that displays the results -->
<table border="1">
<tr><td><b>Variable_name</b></td><td><b>Value</b>
</td></tr>
<?php
for ($i = 0; $i < mysql_num_rows($result); $i++) {
echo "<TR>";
$row_array = mysql_fetch_row($result);
for ($j = 0; $j < mysql_num_fields($result); $j++)
{
echo "<TD>" . $row_array[$j] . "</td>";
}
echo "</tr>";
}
?>
</table>
<?php } ?>
</body></html>
[/PHP]

I am using MySQL 4, PHP 5 and Personal Web Server on Win98

Any help would be greatly apprieciated, thank you.
someonelost
New php-forum User
New php-forum User
 
Posts: 2
Joined: Wed Apr 06, 2005 5:28 am
Location: UK

Postby ruturajv » Wed Apr 06, 2005 8:22 pm

after every mysql function do "or die(mysql_error())"
eg...

Code: Select all
mysql_query($sql, $conn) or die(mysql_error());
User avatar
ruturajv
php-forum Super User
php-forum Super User
 
Posts: 1280
Joined: Sat Mar 22, 2003 9:42 am
Location: Mumbai, India


Return to MySQL Installation

Who is online

Users browsing this forum: No registered users and 0 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.