Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP Databases
PHP Databases Using PHP in conjunction with databases. PHP questions not specific to databases should be directed to one of the other PHP forums.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old November 3rd, 2005, 07:13 PM
Registered User
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default PHP script for MySQL yields white screen


When I try to execute the script below from my company's intranet server, I get a white screen. When I run it on a different web server, it works. Does anyone know why this might be? Is it a "port" that I need to open?

I'm also using PHP5 and MySQL 4.1.13a-nt (I think) on the server where I'm having the problem.

It's working on my personal website's server with PHP 4.3.11 and MySQL 4.0.25 standard.

Here's the script. Thanks in advance!! Josh

$link_id = mysql_connect("localhost", "phpuser", "phppass");
$result = mysql_list_dbs($link_id);
$num_rows = mysql_num_rows($result);

while($db_data = mysql_fetch_row($result)) {
        echo $db_data[0]. "<BR>";
        $result2 = mysql_list_tables($db_data[0]);
        $num_rows2 = mysql_num_rows($result2);
        while($table_data = mysql_fetch_row($result2)) echo "--" . $table_data[0]. "<BR>";
        echo "==> $num_rows2 table(s) in " . $db_data[0] . "<P>";

Josh Gilliam
[email protected]
Old November 18th, 2005, 03:21 AM
Friend of Wrox
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul

I recommend you using mysql_fetch_array() lieu mysql_fetch_row().

To know about errors, just use ini_set('display_errors', '1'); in top of code.

Support Indian students' finances http://scholarship.mediasworks.com/
Old November 30th, 2005, 01:33 PM
Friend of Wrox
Join Date: Jul 2003
Posts: 128
Thanks: 0
Thanked 1 Time in 1 Post

On your personal server you are using 3.23/4.0 mysql version.
The password field number of characters on the old version is 16 byte compared
to 4.1 mysql version of 39/40 byte. When connecting to a mysql database,
your password is always encrypted to the number to bytes for that mySql server. Try on your new version 'localhost', 'root', ''. This is the administrator's default. When you are connected, delete and create your old username and password.

Similar Threads
Thread Thread Starter Forum Replies Last Post
Intermittent Freeze Crystal 8 to White Screen SyraJohn Crystal Reports 4 March 3rd, 2007 11:13 AM
login screen in struts and mysql database [email protected] Struts 1 May 4th, 2006 09:07 AM
Screen Size and Java Script srotondo Classic ASP Professional 5 December 20th, 2004 07:24 PM
How to script search form in PHP/MYSQL javabeans PHP How-To 0 January 12th, 2004 03:53 AM
Call and run CGI script from a PHP script ... how? dbruins BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 1 June 10th, 2003 03:09 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.