i am creating a CMS and have php creating a page. i have a while loop like this

```
while($row = mysql_fetch_array($results)) {
echo "some html code" . $row['name'];

```

its shortend but hopefully you get the point. i have the full thing in my page working just as it should and i wanted to move it to a function include as i want to reuse it. the problem is i do that and it stops working. 

i did some testing and found that the function is getting the query result and after doing a var dump both were identical the problem comes when i try to assign it to an array. it comes back as false so in the above code, for example,

```
$row = false;

```

im toatly lost in this and if my explanation is confusing i appologise but i am a bit of a newbie i have tried searching but....i dont really know where to begin
any thoughts.