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?
|