在下面的代码中,我得到了invoice_id
,但是它给出了INVOICE表的第一条记录Invoice_id。
$invoicenum = $form['invoice'][$i]['inv_id']['#value'];
$invoiceid = db_query('SELECT invoice_id FROM invoice WHERE invoice_number= %d', $invoicenum);
$invoiceid1 = db_fetch_object($invoiceid);
print $invoiceid1->invoice_id;
答案 0 :(得分:1)
您好Alex Gittemeier,
如果您需要发票ID而不是使用此代码
$invoicenum=$form['invoice'][$i]['inv_id']['#value'];
$invoiceid=db_query('select invoice_id from invoice'.
'where invoice_number= %d',$invoicenum);
$invoiceid1= db_fetch_array($invoiceid);
print_r($invoiceid1);
你可以在循环的帮助下从数组中获取发票ID。
此致 Simranjeet singh