call php script from another php script multiple time -



call php script from another php script multiple time -

i have code read info database, , phone call php script (hostes on server) sending retrieved data. 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 code executed once. query 200 results, while executed 1 time. what's wrong?

you have impression executed once...

your code says this:

while $rs = mysql_fetch_array($quary_result) true { }

then $result var overwritten @ each entering in while loop. seek converting $result var array of result , print array see if have values like:

$result[] = curl_exec($ch); echo '<pre>'; print_r($result); echo '</pre>';

also! can utilize foreach() like:

$result = mysql_fetch_array($quary_result); foreach ($result $res) { }

and stop using mysql - deprecated. utilize pdo instead thought in tutorial: pdo tutorial.

php

Comments

Popular posts from this blog

formatting - SAS SQL Datepart function returning odd values -

c++ - Apple Mach-O Linker Error(Duplicate Symbols For Architecture armv7) -

php - Yii 2: Unable to find a class into the extension 'yii2-admin' -