# PHP while loop (noob wants to know why i'm only getting first row)

**URL:** <https://forum.kirupa.com/t/php-while-loop-noob-wants-to-know-why-im-only-getting-first-row/271670>\
**Category:** programming\
**Created:** [September 26, 2008, 5:40am UTC](https://forum.kirupa.com/t/php-while-loop-noob-wants-to-know-why-im-only-getting-first-row/271670 "2008-09-26T05:40:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![natronp](https://avatars.discourse-cdn.com/v4/letter/n/87869e/32.png) [@natronp](https://forum.kirupa.com/u/natronp)\
**Post date:** [September 26, 2008, 5:40am UTC](https://forum.kirupa.com/t/php-while-loop-noob-wants-to-know-why-im-only-getting-first-row/271670/1 "2008-09-26T05:40:50Z")

</div>

noob to php and only returning first record/row with my while loop:

```auto
<?php
$result = mysql_query("SELECT * FROM blogArticles ORDER BY id DESC", $connection);
if(!$result){
echo "Retrieval of Blog entries failed: " . mysql_error();
}
while ($row = mysql_fetch_array($result)){
echo "<strong>>> " . $row['title'] . "</strong> - written by: " . $row['author'] . " " . $row['date'] . " <a href='adminEditBlog.php?id=" . $row['id'] . "> EDIT</a>";
echo "<br />";
}

```

i should mention that if i click on the link i create at the end of my echo, i get a 404 error for adminEditBlog.php?id=1 plus the echo of the second database row. Somehow in my noobness i’m concatenating it all into my link… arghsgs…sdjf.!

what gives? thanks!
