好吧,所以我有一個腳本,從不同的客戶端的PHP頁面生成PDF報告。目前,這一次只能處理一個客戶端,但我想添加一個while語句,以便在從下拉菜單中選擇「所有」客戶端時能夠應對。雖然循環選擇所有聯繫人
while應該從mydatabase.mytable中選擇*個聯繫人,並通過每個聯繫人的正常代碼運行。這是我不知道該怎麼做的一點。
我知道它是這樣的,但不能完全記住語法...
<?php
$client_id=$_POST["client_id"];
$date_start=$_POST["date_start"];
$date_end=$_POST["date_end"];
if ($client_id == 'ALL') {
}
else
{
$command="php myfile.php $client_id $date_start $date_end > myfile.html";
exec($command, $output, $status);
if ($status!=0) {print_r($output); die("wget failed with status $status"); }
$command="wkhtmltopdf-i386 --margin-left 5mm --margin-right 5mm myfile.html myfile.pdf";
exec($command, $output, $status);
if ($status!=0) die("htmltopdf failed");
}
?>
任何建議,將不勝感激
非常感謝
請粘貼您爲1位客戶使用的代碼。 – 2012-02-23 01:05:19
已更新,道歉 – 2012-02-23 01:15:13