L le_toubib Active Member Licensed User Longtime User Sep 19, 2019 #1 Hi When Getting the list of maps from mysql php , the fields order is distorted , how to keep it with the same fields order as in original table . P.s : it's too difficult for me to migrate to jrdc now Thanks
Hi When Getting the list of maps from mysql php , the fields order is distorted , how to keep it with the same fields order as in original table . P.s : it's too difficult for me to migrate to jrdc now Thanks
Erel B4X founder Staff member Licensed User Longtime User Sep 19, 2019 #2 The internal json library will not preserve the order of map items (lists are preserved). Relying on the order of map keys is usually a mistake. Send the column names in a list and use that list to recreate the items in the correct order. Upvote 0
The internal json library will not preserve the order of map items (lists are preserved). Relying on the order of map keys is usually a mistake. Send the column names in a list and use that list to recreate the items in the correct order.
KMatle Expert Licensed User Longtime User Sep 22, 2019 #3 Just create a simple map (in Globals) with the columnnames as the key and the position as the value. When you load the map (row) get the real position from the map. Another one: Mostly you get the single column out of the map by name and then you know where to put it. Upvote 0
Just create a simple map (in Globals) with the columnnames as the key and the position as the value. When you load the map (row) get the real position from the map. Another one: Mostly you get the single column out of the map by name and then you know where to put it.
L le_toubib Active Member Licensed User Longtime User Sep 22, 2019 #4 KMatle said: Just create a simple map (in Globals) with the columnnames as the key and the position as the value. When you load the map (row) get the real position from the map. Another one: Mostly you get the single column out of the map by name and then you know where to put it. Click to expand... Thanks . I used the query : "SHOW COLUMNS FROM tablename" To Load a list of column names beforehand .. Since i needed to use it dynamicaly for multiple tables Upvote 0
KMatle said: Just create a simple map (in Globals) with the columnnames as the key and the position as the value. When you load the map (row) get the real position from the map. Another one: Mostly you get the single column out of the map by name and then you know where to put it. Click to expand... Thanks . I used the query : "SHOW COLUMNS FROM tablename" To Load a list of column names beforehand .. Since i needed to use it dynamicaly for multiple tables