Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > General > General Webmaster Talk
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs
 
 

General Webmaster Talk General webmaster discussion forums - In this forum and its sub forums you can discuss general webmaster related issues or even issues that does not related to Webmastering.
Sub Forums: Running a forum :: Blogs and Blogging :: Word Press Forums :: Digital Photography

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-06-2005, 12:18 PM
seb_
Guest
 
Posts: n/a
Default Connecting to MySQL. Blank Screen :(

I'm haveing 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 Code:
<?php
mysql_connect('localhost','USERNAME','PASSWORD');
mysql_select_db('test');

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


I then went to the mysql and php for dummies website and tried this;
PHP Code:
<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>


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

Any help would be greatly apprieciated, thank you.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 04-06-2005, 05:20 PM
imported_misi
Guest
 
Posts: n/a
Default

Hi,

Please make sure that the MySql is started and if the username and password what you use is okay.



Also when you run the test and see the blank page, on the browser window please right mouse click and click to "View Source". On the opened source code please check if you see php/mysql code, if yes the php or the http server not working okay.



Booth code what you tried to use is okay.



Fir the first code you need to get the result:

"unless you see any error messages, everything should be fine"



For the second:

Variable_nameValue Aborted_clients2Aborted_connects1Bytes_received426 Bytes_sent1304890Com_admin_commands0 ...
..
.

Misi
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 04-06-2005, 05:50 PM
Senior Member
0 posts this year. needs some grease!
New user, who has not interacted much yet.
 
Join Date: Aug 2004
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default

when I do my connect and querys I write it like this

$DBhost = "";
$DBuser = "";
$DBpass = "";
$DBname01 = "";
$table01 = "";

$DBconnect = @mysql_connect($DBhost,$DBuser,$DBpass);
$DBselecDB = @mysql_select_db($DBname01, $DBconnect);
$sql = "SELECT * FROM $table01 ... ";
$result = @mysql_query($sql, $DBconnect);
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-06-2005, 06:39 PM
martian2k4
Guest
 
Posts: n/a
Default

Whoa you loat do it really long, normally i just put

<?php
mysql_connect("localhost","username","password");
mysql_select_db("db_name");
?>

Just a bit shorter than the way you do it
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-06-2005, 06:42 PM
martian2k4
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by seb_
PHP Code:
<?php
mysql_connect('localhost','USERNAME','PASSWORD');
mysql_select_db('test');

echo 'unless you see any error messages, everything should be fine';
?>
Oh btw with that ^^ You will not get any errors appearing, to get it to show the error you would have to add

mysql_connect('localhost','USERNAME','PASSWORD') or die ('There was a error, ' . mysql_error());

Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 04-06-2005, 08:03 PM
seb_
Guest
 
Posts: n/a
Default

Hey,
Thanks for the replys! The source code only shows HTML as the server is fine and so is the PHP. PHPinfo isnt showing the MySQL module so I havent installed it right does any know where I can get a step by step guide to doing this as looking through the net has really confused me.
I have removed everything including my server and am going to reinstall tomorrow so i'm all fresh again. I might jus give up and download XAMP or TRIAD or summin but I really dnt wanna.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Webmaster Resources
UK WW SEO Tools
Find UK Hosts
 
The Forum Rules
Forum Rules - MUST READ
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
43. wholesale adsense ready apple iphone 16gb apple iphone 16gb 3g articles article writer australia web hosting beauty cash casino cheap clothes communications content custard media database dgital camerals domain name english teacher fantasy football fantasy football league fittness football league free handbags home income instant jewelry links link sale medical health money money making online music natural health news nokia n96 16gb one way links online online shop poker professor quality links replica sam allcock seo social networking sony vaio laptop sunglasses technology the medical plus themes tutor verbalized wallet wallets wanted web hosting widget ready wordpress xmas offer

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
AdminPanel is blank isais Boss Cart Installation Help 1 10-10-2007 10:37 AM
SQL ERROR: MySQL connection failed (velnet.driver.mysql) not persistent Piotrek Boss Cart Installation Help 5 06-02-2006 08:59 PM
blank screen (linux+php4.3.3+Apache/1.3.28) still a problem czlowiek iG Shop 0 02-12-2004 08:31 PM
Blank Page rabshire iG Shop 6 08-21-2003 08:41 AM
blank page AL!x iG Shop 2 08-21-2003 08:36 AM


All times are GMT. The time now is 08:56 PM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0