$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']));
}
我只从字段中获取第一组值。我需要所有的价值观。
答案 0 :(得分:5)
您只能从某个功能返回一次。 构建一系列结果并返回:
$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;