Reading out specific Rows in a form

Hi all,

what I need to know and I was trying out for days is that:

I got a table in a MySQL-Database with the fields

Primkey(Double)
Description(varchar(50))
Value(double)

that are shown in a form likes this:

SEQ PrimKey(Hidden) Description(ReadOnly) Value(editable)
1 99 some text Values can be modified
2 103 …
3 64 …

n … … …

For processing the entered data I need to read out what the user entered in Row 3 and storing this data with the PrimKey into another table.
So my question, those answer I could find anywhere:

How can I read out a specific line number in a form? Can someone provide a short code-example or us?

Kind regards and thanks a lot,

Hydro

Re: Reading out specific Rows in a form

I would use the ‘SELECT LAST_INSERT_ID() FROM table’ to get last entry and then create an SQL to get values in another SQL with a WHERE clause.

Regards,
Scott.

Re: Reading out specific Rows in a form

Thank you Scott for your reply,

when I use a form with multiple records, in that I would write many values which would be inserted into the table after clicking the update button: how can I get those (new inserted) records. I assume that the method, that you suggested Scott, would just return a single value.
Does there exist an another method, to get all last inserted values??

Kind regards,

Hydro

Re: Reading out specific Rows in a form

There is no built-in method that I know of to obtain the new record(s) unless SC5 tracks this in a array. (would not bet on this)

I could only suggest that if you have an auto-inc field and that you could get the last_id value before you load the form for new inserts and then upon save, all new ID fields > last_id are your new records. You could SQL all those new ID with a ‘INSERT INTO … WHERE id > last_id’ into the other table.

The only other way that I could think of is to create your own array of records that is append each time to user saves the current record.

I would think the first option would be the easier approach.

Regards,
Scott.

Re: Reading out specific Rows in a form

Thank you Scott,

you saved me plenty of time!

Hopefully, SC5 will provide this method, as it is used after compiling the applications.

Regards,

Hydro