我有这个数据,我使用 mysql select 调用它,然后在行获取数组时调用它
这是我的数据库图像
在该数据库的顶部有保存按钮,所以当我保存数据时,它只保存第一行而不保存第二行。
这是我insert code
的有点长的数据
// COUNTER
$cou = $_POST['cou'];
// USER DETAILS
$user_code = $_POST['user_code'];
$com_code = $_POST['ccode'];
$com_for_track = $_POST['atrack'];
$template_code = $_POST['template_code'];
$logo_position = $_POST['logo_position'];
$logo_width = $_POST['logo_width'];
$add_position = $_POST['add_position'];
$font_size = $_POST['font_size'];
$font_family = $_POST['font_family'];
// FOR COMPANY NAME
$com_name = $_POST['com_name'];
$address = $_POST['address'];
$post_code = $_POST['post_code'];
$city = $_POST['city'];
$country = $_POST['country'];
$email = $_POST['email'];
$kvk_no = $_POST['kvk_no'];
$vat_no = $_POST['vat_no'];
$bank_acct = $_POST['bank_acct'];
$bank_acct_iban = $_POST['bank_acct_iban'];
// CLIENT NAME
$com_name_for = $_POST['com_name_for'];
$sub_quo = $_POST['sub_quo'];
$street_name_for = $_POST['street_name_for'];
$post_code_for = $_POST['post_code_for'];
$city_for = $_POST['city_for'];
$country_for = $_POST['country_for'];
$todays = date( 'Y-m-d', strtotime( $_POST['todays'] ) );
$ex_date = date( 'Y-m-d', strtotime( $_POST['ex_date'] ) );
$fact_year = $_POST['fact_year'];
$inv_num = $_POST['inv_num'];
// COMPUTATION
$quan = $_POST['quan'];
$defi = $_POST['defi'];
$amti = $_POST['amti'];
$tota = $_POST['tota'];
$btwi = $_POST['btwi'];
// SUBTOTAL
$total_f = $_POST['total_f'];
$s_btw = $_POST['s_btw'];
$t_com = $_POST['t_com'];
// FOOTER
$ft = $_POST['ft'];
$i = 1;
while ( $i <= $cou ) {
JON_SQL( "INSERT INTO jon_tem VALUE( ''
,'$user_code'
,'$com_code'
,'$com_for_track'
,'$template_code'
,'$logo_position'
,'$logo_width'
,'$add_position'
,'$font_size'
,'$font_family'
,'$com_name'
,'$address'
,'$post_code'
,'$city'
,'$country'
,'$email'
,'$kvk_no'
,'$vat_no'
,'$bank_acct'
,'$bank_acct_iban'
,'$com_name_for'
,'$sub_quo'
,'$street_name_for'
,'$post_code_for'
,'$city_for'
,'$country_for'
,'$todays'
,'$ex_date'
,'$fact_year'
,'$inv_num'
,'$quan'
,'$defi'
,'$amti'
,'$tota'
,'$btwi'
,'$total_f'
,'$s_btw'
,'$t_com'
,NOW() )" );
$i++;
}
echo '<div id="success">New template has been saved! <a href="index.php?c=cprof">Quotation Settings</a></div>';
如果你看到我放while there
了但它不工作,那么是的它工作并且它循环它 3 次或 bla bla 但它再次只保存第一行数据。
我该如何解决?:(