【问题标题】:How I can Combine two arrays in view and insert into database - Codeigniter如何在视图中合并两个数组并插入数据库 - Codeigniter
【发布时间】:2018-01-13 23:28:42
【问题描述】:

大家好,我是这个平台的新成员...

我正在使用 codeigniter 框架,我认为我有两个不同的数组。第一个数组包含来自名为 customerData 的表单输入的数据,

customerData = {    customerid : customerid,
                    customername : customername,
                    address : address,
                    city : city,
                    phone : phone
                };

第二个是包含动态生成的html表中数据的数组,称为tableData。

如何组合这两个数组并使用 Ajax Jquery 将它们发送到不同的表?

【问题讨论】:

    标签: jquery ajax codeigniter


    【解决方案1】:

    第二张表的数据是什么?

    Javascript 允许你合并两个数组:

    var hege = ["Cecilie", "Lone"];
    var stale = ["Emil", "Tobias", "Linus"];
    var children = hege.concat(stale);
    

    【讨论】:

    • 我的想法是为发票销售创建一个页面,在该页面上,客户的信息被输入到上面数组中指定的表单输入中......第二个数组应该包含所有购买的商品的数据动态添加到 HTML 表中。然后表单输入和 html 表中的数据都应该保存到我的数据库中
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 1970-01-01
    • 1970-01-01
    • 2017-09-10
    • 1970-01-01
    • 2011-11-18
    相关资源
    最近更新 更多