functions?
| From: | zerosumzero@yahoo.com | Date: | Fri, 06 Jul 1979 15:27:01 +0000 |
| Subject: | functions? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56506@lists.php.net to get a copy of this message | ||
Okay there is a file called global.inc
<?php
// display a list from the DB
function list_of_maps () {
db_connect ();
$sql = "SELECT mapname,rowid FROM maps";
$result = mysql_query($sql);
while ($row = mysql_fetch_row ($result)) {
return "<a
href='viewonly.php3?mapid=$row[1]'>$row[0]</a><br>"; }
}
?>
But when I call it like this:
<?php
include('global.inc');
echo list_of_maps ();
?>
It only shows the first result from the db... How do I get it to list them
all?
Susan