Hi, many thanks for your reply, i thought the same and add EOF, now when i run the last product is looping and like this
ST,387,0,Wolf Bench Grinder - WBG200/MD200F - Home - Tools - DIY,0.0000,0
ST,360,0,Wolfcraft TS 800 Adjustable Trolley - Home - Garden,0.0000,0
ST,116,0,WWE Ruthless Aggression 6 Pack - Wrestling Game - RARE - Retro,0.0000,0
ST,419,0,Zinc Ion XY Black Folding Scooter - Outdoors - Toy,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
ST,220,0,Zoobles Mama & Zoobling Trinka and Tito & Tonia #306 Play Set,0.0000,0
the last product loops thousands of times,
Any idea how to stop the loop when the last product has been displayed, i have tried
for($i=0;$i<$products_stock->rowCount();$i++) {
$output = array();
$output["tx_type"]='ST';
$output["Stock_Code"]= $products_stock->fields['products_id'];
$output["Qty"]= $products_stock->fields['products_quantity'];
$output["Description"]= $products_stock->fields['products_name'];
$output["CostPriceEx"]= $products_stock->fields['products_cost'];
$output["TotalCostEx"]= $products_stock->fields['products_cost'] * $products_stock->fields['products_quantity'];
zen_sages_fwrite($output);
$products_stock->MoveNext();
}
but it white screens, i really appreciate any help
Thank you
Russell



Reply With Quote
