New web app with CF4 new things to learn....
I create a form with db loader action and with a where statement .
I could capture the value of a column (autoindex autoincrement field in the db) as cf_id.
But I have the value of the first row in the table ("1").
I couldn't understand how to use insertid to obtain the last value of the field in the table (like mysql last_insert_id).
I have make a request in where statement as:
$lastid=$database->insertid();
then capture the data with an echo that call $lastid.
But it couldn't pass the data.
Is it possible to have some hints about the sintax that I've to use?
Thanks in advance.
bye
fede
I'm sorry but I don't understand what you are trying to do here?
Please see this FAQ if you need to know the ID of a saved record.
Bob
I need to obtain last id of a field cf_id in a table, then use the value +1 as counter.
like http://www.chronoengine.com/forums/posts/t10525/p10525.html in CF4.
bye
fede
I could capture the value of a column (autoindex autoincrement field in the db) as cf_id.
But I have the value of the first row in the table ("1").
and this is ok.
I use:
cf_id<?php echo $form->data('cf_id']:?>
the "only" sintax that return me a value.... (in the where statement of the db loader action)
I need to obtain the last value in the last record ( the last row).
solution one:
If I try to sort the data with ORDER BY i couldn't find the correct sintax.
In the help of the db loader action:
-You can order the results and so control which record will be returned, use "ORDER BY" word in the WHERE box. e. g. ORDER by 'id'
I had try to add the "Order by" that should be DESC without success.
solution two:
I had try also to count the row but I didn't find a correct sintax that returns me data.
I search in the forum but didn't find case of use a row count in the where staement in dbloader.
bye
fede
