Buy Now
Sign in

print out the last row of table

tcjay , September 10 2008, 15:47
T
tcjay 16
September 10 2008, 15:47 #13099
I am trying to display the last row of the form table using ChronoConnectivity.

I am using this as the where statement:

cf_id=(select max({cf_id}) from jos_chronoforms30)

I am receiving this error message:

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=(select max(default) from jos_chronoforms30)' at line 1 SQL=SELECT count(*) FROM jos_chronoforms_30 cf_id=(select max(default) from jos_chronoforms30)

Max:

Could you be so kind as to look at my syntax to identify the error.

TIA Tom
admin 29
September 10 2008, 18:40 #13105
Hi tom,

I think you should remove the brackets around cf_id => {cf_id} ??
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
T
tcjay 16
September 11 2008, 10:28 #13160
Max:

This is an explaination of my procedures and what I am trying to accomplish.

1. Created an order form using Chronoform which saves each transaction in the database.
2. After the form is entered and the data is saved, redirected to display the order using Chronoconnectivity.
3. The last row in the table should display the last order.

Does this make sense to you?
admin 29
September 11 2008, 12:50 #13167
this will not change anything with the code we are building now, did you try what I suggested ?
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
T
tcjay 16
September 11 2008, 17:06 #13212
Max:

I am not quite sure which set of brackets you are referring to. This is the code I am using;

cf_id=(select max{cf_id} from jos_chronoforms30)

This is the error message I am receiving;

ou have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=(select maxdefault from jos_chronoforms30)' at line 1 SQL=SELECT count(*) FROM jos_chronoforms_30 cf_id=(select maxdefault from jos_chronoforms30)

Warning: Invalid argument supplied for foreach() in /home/content/e/a/r/earthplanet/html/components/com_chronoconnectivity/chronoconnectivity.html.php on line 137

Thanks for your help.

Tom 8)
admin 29
September 12 2008, 04:39 #13227
Hi Tom, I think it should be max(cf_id) not max{cf_id}
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
T
tcjay 16
September 12 2008, 09:53 #13249
Max:

The following error appears when I use cf_id=(select max(cf_id) from jos_chronoforms30)

You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '=(select max(cf_id) from jos_chronoforms30)' at line 1 SQL=SELECT count(*) FROM jos_chronoforms_30 cf_id=(select max(cf_id) from jos_chronoforms30)

Warning: Invalid argument supplied for foreach() in /home/content/e/a/r/earthplanet/html/components/com_chronoconnectivity/chronoconnectivity.html.php on line 137

Tom 8)
admin 29
September 12 2008, 11:24 #13253
I see you didn't add the WHERE word ?
Max
If your main question got answered then please mark the answer using the button!
Did you try the new ChronoForms7 ? if yes then please send us your comments!!
T
tcjay 16
September 12 2008, 21:04 #13289
Thank you!