can someone please help me debug my php?

keiko

New member
Hya, I've created a php script to loop through a table and print out a list of store address under a heading. The heading's print okay and there is room "allocated" under each heading as if invisible records are being printed, but there isn't any data printed.

Here's my code, does anyone have any suggestions on what could be causing the problem? Thank you:

<?php

$storeQuery = "SELECT store.StoreID,
store.StoreAddress1,
store.StoreAddress2,
store.StoreAddress3,
store.StorePostcode,
store.StorePhoneNo

FROM store;";

$result = mysql_query($storeQuery);

while ($row = mysql_fetch_array($result))
{
$storeHeader = $row['store.StoreID'];
$storeAddress1 = $row['store.StoreAddress1'];
$storeAddress2 = $row['store.StoreAddress2'];
$storeAddress3 = $row['store.StoreAddress3'];
$storePostCode = $row['store.StorePostcode'];
$storePhoneNo = $row['store.StorePhoneNo'];

echo "<h3 class='storeHead'>Store ".$storeHeader."</h3>";
echo "<p>".$storeAddress1."<br /></p>";
echo "<p>".$storeAddress2."<br /></p>";
echo "<p>".$storeAddress3."<br /></p>";
echo "<p>".$storePostCode."<br /></p>";
echo "<p>".$storePhoneNo."</p>";

}
mysql_free_result($result);
mysql_close();
?>
 
Embed the variables in the strings and see if it works, like this:
echo "<p>".$storeAddress1."</p>";
becomes
echo "<p>$storeAddress1</p>";
 
Back
Top