print out the last row of table

tcjay 10 Sep, 2008
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 arrow-right
Max_admin 10 Sep, 2008
Hi tom,

I think you should remove the brackets around cf_id => {cf_id} ??
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tcjay 11 Sep, 2008
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? ๐Ÿคจ
Max_admin 11 Sep, 2008
this will not change anything with the code we are building now, did you try what I suggested ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tcjay 11 Sep, 2008
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)
Max_admin 12 Sep, 2008
Hi Tom, I think it should be max(cf_id) not max{cf_id}
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tcjay 12 Sep, 2008
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)
Max_admin 12 Sep, 2008
I see you didn't add the WHERE word ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
tcjay 12 Sep, 2008
Thank you! ๐Ÿ˜€
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger