I want to do something like this:
$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'];
}
}
But I am not sure what is the best way to reset the $result variable. Or does it need to be reset? What is the best way for me to extract the value into the $creator_member_id variable?
Thanks!
If you want to keep the previous results, just do the query into a different array.
$result2 = mysql_query($select);
It would help if you explained what you were trying to query though as I think you may be doing more queries than you actually need to do.