So I have two places on my page where I want to print out a list of items…
The first list prints but the second one won’t, what gives?
Here’s my code at the top of the file:
<? include("inc/header.php");
include("inc/config.php");
dbConnect(); $qa_sql = "SELECT * FROM catalyst_course WHERE status ='1'";
$qa = mysql_query($qa_sql);
?>
And here are the two lists I want to create:
List One
<?
while ($qa_row = mysql_fetch_array($qa, MYSQL_BOTH))
{
?>
• <a href="#"><? print ($qa_row['title']); ?></a><br>
<?
}
?>
List Two
<?
while ($qa_row = mysql_fetch_array($qa, MYSQL_BOTH))
{
?>
<div id="cReg">
<div id="cRegTxt"><? print ($qa_row['title']); ?></div>
<div id="cRegBtnCc">
<div id="cRegBtn"><a href="inc/regForm.php?id=<? print ($qa_row['id']); ?>" >
</a></div>
</div>
</div>
<div id="cRegContent">
<? print ($qa_row['body']); ?></div>
<div id="cRegFooter"></div>
</div>
<?
}
?>
So I’m basically just calling that query twice on the same page, the first time to create a list of items at the top of the page to create a list of anchor links to jump futher down into the page…
The anchor list will print but the other identical list won’t, what am I doing wrong? Thanks so much in advance!