Reputation: 23634
$result = mysql_query("SELECT * FROM project ORDER BY projectid");
while($row = mysql_fetch_array($result))
{
return(array($row['projectid'], $row['clientname'],
$row['salesperson'], $row['prospect']));
}
I get only the first set of values from the fields. I need all the values.
Upvotes: 1
Views: 91
Reputation: 321736
You can only return once from a function. Build an array of results and return that:
$result = mysql_query("SELECT * FROM project ORDER BY projectid");
$values = array();
while($row = mysql_fetch_array($result))
{
$values[] = array($row['projectid'], $row['clientname'], $row['salesperson'], $row['prospect']);
}
return $values;
Upvotes: 5