Heya, Rocky.
hi plss help I need to noe what this php code is doing
[PHP]
while($row = mysql_fetch_array($resultpostal))
{
$temp[]=$row;
}
foreach($temp as $key=>$extract)
$report=$report.$key."=".$extract."&";
[/PHP]
mysql_fetch_array() (s/b mysql_fetch_assoc()) will return an array of results from the last MySQL query, or false if there are no more results in the query.
Each time it gets a result, we'll append it to $temp. As a result, $temp becomes an array that stores all of our MySQL results.
Then, for each row in $temp, we will have a set of keys, which match the MySQL columns, and '$extract', which are the retuned values.
We append each entry to $report, set up to be sent in a URL.
Of course, the
http_build_query() function does that last part for you....
-
while($row = mysql_fetch_assoc($resultpostal))
-
$report .= ($report ? '?' : '&') . http_build_query($row);
-