Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 24th, 2005, 11:37 AM
Registered User
 
Join Date: Nov 2003
Location: , , .
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?
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 09:44 PM.


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