# Newbie mysql php data extraction question

**URL:** https://forum.kirupa.com/t/newbie-mysql-php-data-extraction-question/243613
**Category:** Uncategorized
**Created:** [November 8, 2007, 9:59pm UTC](https://forum.kirupa.com/t/newbie-mysql-php-data-extraction-question/243613 "2007-11-08T21:59:11Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![atarijake](https://avatars.discourse-cdn.com/v4/letter/a/7cd45c/32.png) [@atarijake](https://forum.kirupa.com/u/atarijake)
#### Post date: [November 8, 2007, 9:59pm UTC](https://forum.kirupa.com/t/newbie-mysql-php-data-extraction-question/243613/1 "2007-11-08T21:59:11Z")

</div>

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:

```auto

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

```auto

            <?
            while ($qa_row = mysql_fetch_array($qa, MYSQL_BOTH)) 
            {
             ?>
            
             &bull; <a href="#"><? print ($qa_row['title']); ?></a><br>

            <? 
            } 
            ?>

```

List Two

```auto

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