我可以使用payment_status = rand('pending','success','failed','refunded')
進行下面的查詢,或者任何人都可以幫助我解決以下查詢的錯誤。我可以使用rand('等待','成功','失敗','退款')
for ($i=0;$i<100000;$i++)
{
$payment_status = rand('pending','success','failed','refunded');
$sql = 'INSERT INTO `aa_kkkk` (`id`, `user_id`, `biz_id`, `filing_year`, `filing_month`, `final_return`, `consent_disclosure`, `is_third_party_designee`, `amended_month`, `earliest_date`, `latest_date`, `tax_year_end_month`, `address_change`, `form_type`, `submission_id`, `payment_status`, `transaction_id`, `active`, `xml_submitted`, `date_user_submitted`, `date_xml_sent`, `date_last_ack_attempt`, `date_acknowledged`, `created_date`, `modified_date`, `next_submission_date`, `irs_approved`, `ack_received`, `sch1_received`, `sch1_path`, `user_completed`, `consent_to_submit`, `error_code`, `error_description`, `error_type`, `modifiedby_admin`, `data_masked`, `form_pdf_path`) VALUES
(Null, ':user_id', ':biz_id', ':filing_year', "c2aaf5544415889e720f042b04551c97'.$i.'", "c9c396be60e066ae92b978c08a3fca0a'.$i.'", "32b20aa703b1128d448321b83fe57d70'.$i.'", "0", "32b20aa703b1128d448321b83fe57d70'.$i.'", "32b20aa703b1128d448321b83fe57d70'.$i.'", "32b20aa703b1128d448321b83fe57d70'.$i.'", "32b20aa703b1128d448321b83fe57d70'.$i.'", "32b20aa703b1128d448321b83fe57d70'.$i.'", "84843320140520033138'.$i.'", ':payment_status', "", ':transaction_id', ':active', "2014-02-21 10:31:35", "2014-02-21 03:31:42", "2014-02-21 03:32:00", "2014-02-21 03:32:00", "2014-02-21 03:11:15", "2014-04-18 11:12:39", NULL, ':irs_approved', ':ack_received', ':sch1_received', "84843320140520033138.pdf'.$i.'", 1, 1, "", "", "", 0, 0, "pf2290_1_84843320140520033138.pdf'.$i.'")';
http://www.php.net/manual/en/function.rand.php – PeeHaa
'int rand(int $ min,int $ max)'no,no you can not。我建議編輯該問題以更好地反映您想要做的事情,而不是要求您選擇的(有缺陷的)解決方案提供幫助。另外,問題中絕對沒有mysql--你如何使用'$ payment_status'與「問題」無關。 – AD7six