Below is what I have and I'm not quite about the retrieving data frm MySQL database.
require_once('Connections/alumniConnection.php');
mysql_select_db($database_alumniConnection, $alumniConnection);
$query_rsArchived = "SELECT DISTINCT Description FROM photoGallery WHERE category = 'archived'";
$rsArchived = mysql_query($query_rsArchived, $alumniConnection) or die(mysql_error());
$row_rsArchived = mysql_fetch_assoc($rsArchived);
$totalRows_rsArchived = mysql_num_rows($rsArchived);
echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">";
And then in the body, I have this:
for($numOfCells=0; $numOfCells<=$totalRows_rsArchived; $numOfCells++){
echo "Results2: ".$row_rsArchived["Description"]."<br>";
while($row_rsArchived = mysql_fetch_assoc($rsArchived)){
echo "Results3: ".$row_rsArchived["Description"]."<br>";
}
}
The above body tag codes displayed this:
Results2: Appleton Gathering
Results3: Wausau Gathering
Results3: Retired Faculty/Staff Breakfast
Results2:
Results2:
Results2:
However, if use this body tag code:
for($numOfCells=0; $numOfCells<=$totalRows_rsArchived; $numOfCells++){
echo "Results2: ".$row_rsArchived["Description"]."<br>";
}
Then the result display this:
Results2: Appleton Gathering
Results2: Appleton Gathering
Results2: Appleton Gathering
Results2: Appleton Gathering
And if I use the body tag code:
while($row_rsArchived = mysql_fetch_assoc($rsArchived)){
echo "Results3: ".$row_rsArchived["Description"]."<br>";
}
Then the result displayed:
Results3: Wausau Gathering
Results3: Retired Faculty/Staff Breakfast
Now, my question is how do I get it to display as show below?
Results2: Appleton Gathering
Results2: Wausau Gathering
Results2: Retired Faculty/Staff
What's the proper loop?
ljCharlie