Hi, could someone please help me.
I am trying to create an SQL query within a PHP page that will then loop through all records within a table of store locations and print them one by one, I would like to have a heading underlined and a space between each output. I've tested my query in my database and that runs okay, but I'm struggling with the PHP I think it something to do with the quotes.
Here's what I have so far:
$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))
{
// this is the bit I'm struggling with
}
Here's an example of what the XHTML that I would like to have working within the above loop:
<h3 class="storeHead">Store 1</h3>
<p>24 Yahoo Lane, Hootlee, Beckle, 124 543, Tell: 894423584</p>
Thank you
Thanks, I am still having problems. I have got the "store" heading to bring up the correct amount of times and there is now space under each heading, but with no values underneath??? here is my full code if that helps.
<?php
//this creates a variable named query. Which is a concaternated string (using the .) The $_POST is getting the contents of the post from the form.
$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($resul
I am trying to create an SQL query within a PHP page that will then loop through all records within a table of store locations and print them one by one, I would like to have a heading underlined and a space between each output. I've tested my query in my database and that runs okay, but I'm struggling with the PHP I think it something to do with the quotes.
Here's what I have so far:
$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))
{
// this is the bit I'm struggling with
}
Here's an example of what the XHTML that I would like to have working within the above loop:
<h3 class="storeHead">Store 1</h3>
<p>24 Yahoo Lane, Hootlee, Beckle, 124 543, Tell: 894423584</p>
Thank you
Thanks, I am still having problems. I have got the "store" heading to bring up the correct amount of times and there is now space under each heading, but with no values underneath??? here is my full code if that helps.
<?php
//this creates a variable named query. Which is a concaternated string (using the .) The $_POST is getting the contents of the post from the form.
$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($resul