我想做这样的事情:
$select = "select some_fiels from some_table";
$result = mysql_query($select);
if (mysql_num_rows($result) > 0 )
{
$rows = array();
while($r = mysql_fetch_assoc($result))
{
$rows[] = $r;
}
echo json_encode($rows);
// THIS IN ORDER TO EXTRACT THE VARIABLE VALUE FOR USE LATER IN THE SCRIPT
while($row = mysql_fetch_assoc($result))
{
$creator_member_id = $row['creator_member_id'];
}
}
但我不确定重置 $result 变量的最佳方法是什么。还是需要重新设置?我将值提取到 $creator_member_id 变量中的最佳方法是什么?
谢谢!