how to get data from a datagrid column to get highest number
Posted: Wed Jul 01, 2015 8:26 pm
Hi,
i'm strugling to find the highest nr in a column.
The column represents the number of rows in the datagrid.
Now i used 2 simple commands and they give a number but it is less then the actual numbers in the column.
I've checked the lessons and tutorials but they seem to point only to get data from a row when clicked on.
I want a simple check to get the highest nr in the Number column, so i can add a new row in the database directly and then read it out again and put all info renewed in the datagrid.
So i know it is actually written into the database. (so this adding goes thru php scripts and is working, and yes i know it is possible to do this automatically via mysql statements) but then i can't see whats happening. I want ot be sure it gets the highest value avalable and add 1 to it.
it tried this:
any help will be appreciated.
Thanks!
Sphere
i'm strugling to find the highest nr in a column.
The column represents the number of rows in the datagrid.
Now i used 2 simple commands and they give a number but it is less then the actual numbers in the column.
I've checked the lessons and tutorials but they seem to point only to get data from a row when clicked on.
I want a simple check to get the highest nr in the Number column, so i can add a new row in the database directly and then read it out again and put all info renewed in the datagrid.
So i know it is actually written into the database. (so this adding goes thru php scripts and is working, and yes i know it is possible to do this automatically via mysql statements) but then i can't see whats happening. I want ot be sure it gets the highest value avalable and add 1 to it.
it tried this:
Code: Select all
on mouseUp
#get the dgNumberOfRecords of group "Datagrid 1" ----this give 2157 while there are actually 2159 rows including row 0
#get the dgNumberOfLines of group "Datagrid 1" -----same as above
#put "Number"into pColumns
repeat for each line tLine in the dgColumn["Number"] of group "Datagrid 1"
put GetDataOfIndex(the dgIndex of me, the dgColumn["Number"] of group "Datagrid 1") into theColumnValue
pput the last line of theColumnValue into field "test"
#answer it
end repeat
end mouseUp
Thanks!
Sphere