![]() |
Retrieve data error...plz help
hello ppl!
i have a xml file and i refresh it with a php file... into the php file i have a query which i retrieve my data from a sql db...the output result is n't the right...because it "write" to the xml file only the last record from db...look what i mean: php file: PHP Code:
PHP Code:
thank you friendly |
PHP Code:
|
Try to replace this before while loop:
$myFile = "data.xml"; $fh = fopen($myFile, 'w') or die("can't open file"); $stringData = "<?xml version=\"1.0\" encoding=\"ISO-8859-7\" ?>\n\n"; And this: fclose($fh); just after. You are looping through each register of database, and for each one, you are openning the file, writing xml header, writing one register and closing the file, n times. |
Oh, just one more thing, the $stringData must concatenate the strings, so inside the while loop you'll have:
$stringData .= "<gallery>\n\n<photos>\n"; ... |
| All times are GMT. The time now is 05:26 AM. |
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0