Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9016403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T03:59:12+00:00 2026-06-16T03:59:12+00:00

i have this data and im calling it using mysql select then while row

  • 0

i have this data and im calling it using mysql select then while row fetch array

here is my image of the database
enter image description here

on top of that database there is save button
so when i do save the data, it only save the first row but not the second row.

here is my insert code its kinda long data

// 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>';

if you see i put while there but its not workin, well yes its working and it loop it 3 times or bla bla but again it only save the first row data.

how can i fix it? 🙁

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T03:59:14+00:00Added an answer on June 16, 2026 at 3:59 am

    I finaly fixed it.

    heres is the updated code.

    $i = 1;
    while ( $i <= $cou ) {
    
    // COMPUTATION
    $quan = $_POST['quan_'.$i];
    $defi = $_POST['defi_'.$i];
    $amti = $_POST['amti_'.$i];
    $tota = $_POST['tota_'.$i];
    $btwi = $_POST['btwi_'.$i];
    
    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++;
    }
    

    and the html code

    $i = 1;
    while( $row = mysql_fetch_array( $sqlview ) ) {
    ?>
        <tr>
            <td><?=$row['category'];?></td>
            <td>
                <input type="hidden" name="atrack" value="<?=$row['com_track'];?>" />
                <input type="hidden" name="quan_<?=$i;?>" value="<?=$row['quo_quantity'];?>" />
                <input type="hidden" name="defi_<?=$i;?>" value="<?=$row['quo_definition'];?>" />
                <input type="hidden" name="amti_<?=$i;?>" value="<?=$row['quo_amt'];?>" />
                <input type="hidden" name="tota_<?=$i;?>" value="<?=$row['quo_total'];?>" />
                <input type="hidden" name="btwi_<?=$i;?>" value="<?=$row['quo_btw'];?>" />
                <?=$row['quo_quantity'];?> x
            </td>
            <td width="200">
                <?=$row['quo_definition'];?>
            </td>
            <td>
                <?=$msg_tot;?> <?=$row['quo_amt'];?>
            </td>
            <td id="total">
                <input type="hidden" name="sumof" value="<?=$row['quo_total'];?>" />
                <?=$msg_tot;?> <?=$row['quo_total'];?>
            </td>
            <td>
                <?=$row['quo_btw'];?>
            </td>
        </tr>
     <?
     $i++;
    }
    

    thank you guys for the idea. very appreciate it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using PostgreSQL 9.1 and I have this data structure: A B ------- 1
I have three identical drop down lists that I'm populating using MySQL data. If
I have a problem while I need to send data using uploadify script. For
I have a function that retrieves data from a Mysql database, stores the values
I have this problem.. I'm receiving data from a client..Using a socket connection. But
I have this data in cell A1: Majestic Properties Design District, LLC, Ste. 101,
i have this data | car_name | year | price | Honda | 2011
I have this data from a xml file: <?xml version=1.0 encoding=utf-8 ?> <words> <id>...</id>
I have this data: /blabla/blabla (abs,def) /yxz I use this regex (.*)(?:\(([^$]*)\))?\n But it
I have this data: 1, 0., 0., 1500. . . 21, 0., 2000., 1500.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.