Quantcast
Channel: ASPRunner forums
Viewing all articles
Browse latest Browse all 2586

[SOLVED] Explaination question Custom Button

$
0
0
Hi,
I do not know what happens, can somebody please explain.

I want to write an array to a text document.
Whatever i do, i receive only the last row of the array. "Bread"

My main perpose is to query with a custom button to the Order Table and take out all the rows related to the PreOrder Table.


$data = $button->getCurrentRecord();
$som1 = str_pad($data["id"],7,0,STR_PAD_LEFT);
$idvalue = "ORDER".$som1 ;

$myFile = ("Orders/Article_".$idvalue.".dds");

$foodArray = ["Eggs", "Bacon", "HashBrowns", "Beans", "Bread"];

foreach ($foodArray as $food) {
$fh = fopen($myFile, 'w') or die("can't open file");
$stringData = $food ."\r\n";
fwrite($fh, $stringData);
}
fclose($fh);

$num = 0;

while ( $num < $y )

{

// print $num . " ";

exec ("Orders/".$myFile.".dss");
exec ("Orders/".$myFile1.".dss");
$num++;

}

Viewing all articles
Browse latest Browse all 2586

Trending Articles