B4J Question Preserve mysql table fields order in json

le_toubib

Active Member
Licensed User
Longtime User
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
 

KMatle

Expert
Licensed User
Longtime User
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

le_toubib

Active Member
Licensed User
Longtime User
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.
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
Top