I have another issue. I have a fairly large script that requires data to be 
read for 2 separate purposes from the results of the same query. e.g.:



$phish = $_GET["phish"];

$result = mysql_query("SELECT foo, bar, steak FROM footable WHERE foo LIKE 

// loop *1*
where (mysql_fetch_array($result) as $row1) {
    $crab = $row1["bar"];

print $crab;




// loop *2*

$array_stuff = array();
$line = 0;

where (mysql_fetch_array($result) as $row1) {
    $array_stuff[$line] = array()
    $array_stuff[$line]["foo"] = $row1["foo"];
    $array_stuff[$line]["bar"] = print $row1["bar"];
    $array_stuff[$line]["steak"] = print $row1["steak"];

print_r $array_stuff;



>From the above code, loop 2 returns a blank array, the output is simply "Array 
>()". If I remove the loop (by commentiung it out) that extracts $crab the 
>mysql $result array is suddenly full of the correct values. It seems to me 
>that loop 1 is destroying or somehow not resetting $result. Very odd...

Mark Benson


PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to