0

I am using Datatables Editor to update data server side.Json data i get from server is -

{
  "data": [
    {
      "DT_RowId": "row_1",
      "resistors": {
        "Part_Name_Prefix": "",
        "Part_Number": "RES 25 Ohms - \u00b11% - 0402",
        "Voltage": "",
        "Tolerance": "\u00b15%",
        "Value": "25 Ohms",
        "CPN": "800-00001",
        "Library_Ref": "RES",
        "Library_Path": "LIB001.SchLib",
        "Comment": " =Value",
        "Component_Kind": "Standard",
        "Component_Type": "Standard",
        "Description": "0402, 25 OHM",
        "Designator": "",
        "Manufacturer": "AVX Corporation",
        "Manufacturer_Part_Number": "UBR0402B250FZTR500",
        "Manufacturer1": "",
        "Manufacturer_Part_Number1": "",
        "Packaging": "",
        "Pin_Count": "2",
        "Signal_Integrity": "",
        "Simulation": "",
        "Supplier": "Digi-Key",
        "Supplier_Part_Number": "478-12027-2-ND",
        "Supplier1": "122456-43",
        "Supplier_Part_Number1": "mouser",
        "Footprint_Path": "LIB001.PcbLib",
        "Footprint_Ref": "RES0402",
        "ComponentLink1Description": "Datasheet",
        "ComponentLink1URL": "http:\/\/datasheets.avx.com\/AVX-UBR-Series.pdf",
        "Status": "green",
        "revise_datasheet": "unknown",
        "revision": "O",
        "date": "2019\/04\/12",
        "RoHS": "RoHS Compliant",
        "Life_cycle": "Active",
        "Lead_free": "Lead free",
        "part_img": "pdfimg\/LIB001\/partimg\/RES-L9-PIMG-UBR0402B250FZTR500.jpg",
        "sym_img": "",
        "pcb_img": "",
        "threeD_img": "",
        "Power Watts": "",
        "Composition": "",
        "Temperature Coefficient": "",
        "Size Dimension": "",
        "Height Seated Max": "",
        "Co_PN": "123-blah",
        "[Footprint Path 2]": "LIB001.PcbLib",
        "[Footprint Ref 2]": "RES0805"
      },
      "revision": {
        "userID": "System User"
      }
    },

As you can see last two column names have brackets around it.

Datatables not showing data for these two columns and giving error while updating.

Error given in debugger is-


Notice: Undefined index: [Footprint Path 2] in C:\xampp\htdocs\members\DataTables-1.10.18\extensions\Editor-1.9.0\php\Editor\Field.php on line 574

Notice: Undefined index: [Footprint Ref 2] in C:\xampp\htdocs\members\DataTables-1.10.18\extensions\Editor-1.9.0\php\Editor\Field.php on line 574
{"error":"SQLSTATE[HY093]: Invalid parameter number: parameter was not defined"}

Could you please help me to solve how is it possible to do work on editor with this column name in database.

Tracy
  • 53
  • 4
  • I think its because Json square brackets are conflicting with square brackets in column name . Can anyone suggest some method to overcome this. – Tracy Mar 16 '20 at 17:12
  • The array key includes literal square brackets, so your array access would look like `$foo['data']['[Footprint Path 2]'];` – Sammitch Mar 16 '20 at 17:17
  • @Sammitch but its inside datatables. So i am confused about formatting in datatables syntax – Tracy Mar 16 '20 at 17:25

0 Answers0