i have this code for read some data from a database, and call another php script (hostes on another server) for sending retrieved data. this is my code:
while ($rs = mysql_fetch_array($quary_result)) {
$fields = array(
'field1' => $rs['field1']
);
$postvars = http_build_query($fields);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars);
$result = curl_exec($ch);
curl_close($ch);
}
but this code is executed only once. My query as about 200 results, while is executed only one time. What's wrong?