Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 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 April 24th, 2005, 11:37 AM
Registered User
 
Join Date: Nov 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem running PHP locally

I have installed php 4.3.11 on to my Windows XP machine.
I have configured IIS, which seems to be working.

I have created a php info file;

<?
phpinfo();
?>

And when I run this it returns the php info data as expected.

I have installed MySQL 3.23.56-nt, which again is running correctly.

Now to the problem.
I have a php file that runs a MySQL Query.

Here is the php file I have created:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<TITLE>Test</TITLE>
</HEAD>
<BODY bgcolor="#ffffff">
test Page<br>
<?
    $Database=mysql_connect("localhost","test", "test123");

    $strSQL="SELECT * FROM tbl_ArticleHeader_New";

    $Results = mysql_query($strSQL);

    $Data = mysql_fetch_array($Results);

    $Continue=1;
    $RecordsFound=1;

    while($Continue==1)
    {

        echo "<BR>Article Type:".$Data["ArticleType"]."<br>";

        $Data = mysql_fetch_array($Results);

        $RecordsFound=$RecordsFound+1;

        if ($RecordsFound>3)
        {
            $Continue=0;
        }

    }

?>
</BODY>
</HTML>

When I run this page it loops 3 times as expected, but the variable $Data["ArticleType"] is blank.

I am 100% sure that there is data in the table, and the column is named correctly. If I run the query directly at the MySQL prompt data is returned.

Also, if I upload this code to my webserver and run it online, it does return data. (I have exactly the same database online as I do locally, and I am using exactly the same code.)

So, my question is, why is the array $Data not displaying anything locally?





Similar Threads
Thread Thread Starter Forum Replies Last Post
Running PHP Triad on Win98 - Help with email? timmaher Pro PHP 5 November 22nd, 2006 03:43 AM
Problem running php files on IIS sami1925 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 September 14th, 2005 09:41 AM
Installed PHP manual locally-How do I access it? ababb BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 January 20th, 2005 08:09 PM
Php running problem Yee PHP How-To 5 October 26th, 2004 08:58 PM
php downloads instead of running ss2003 Beginning PHP 2 February 16th, 2004 03:25 PM





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