Forums

Following tutorial receive error 1064

hennysmafter 05 Jul, 2013
Dear Max, Greyhead and other users of the chronoforms component.

I have the following setup:

Joomla! 3.1.1 Stable with standard template
Joomla Platform 12.2.0 Stable
Chronoforms V4 with plugin and module

I have followed the tutorial "CFV4_db_save.pdf" and I am now following the next tutorial "CFV4_db_record_loader.pdf" but I cant finish it.

First of all there is no "Load Fields" so I started looking on google and found the following tutorial which is more up to date with the current version of chronoforms.
http://www.chronoengine.com/faqs/2698-how-to-load-one-row-from-a-db-table-into-your-form.html

In this tutorial I can only get to step 10 because when I test my form I get the following error.

Error 1064: 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 '' at line 1 SQL=SELECT * FROM `sjlgw_chronoforms_data_user_details` AS `SjlgwChronoformsDataUserDetails` WHERE

What am i doing wrong. Any help would greatly be appreciated!

PS: Here is the form I use!
[attachment=0]CFV4_FormsBackup_ON_05_Jul_2013_13-47-20.zip[/attachment]
GreyHead 05 Jul, 2013
Hi hennysmafter,

Pleas type 1 in the WHERE box of the DB Multi-Record Loader; there's a little bug that breaks it if the WHERE clause is empty. "WHERE 1" is always true so had no effect on the query.

Bob
hennysmafter 05 Jul, 2013
Hello Greyhead,

Thank you for your response. I have tested your suggestion and it is showing the form now. But according the tutorial I should receive an empty form but I get the form already filled in with the details that I added in the previous tutorial.

But never mind the tutorials because that is not what I want to achieve. I want to create a form that a logged in user can change the menu title, alias and path. For this I need to access the #####_menu table. I am using the following form for this.

[attachment=0]CFV4_FormsBackup_ON__05_Jul_2013_22-00-31.zip[/attachment]

Basically this form has 3 fields and a submit button. The details of the fields are as follows.
Labeltext: title
fieldname: title
Labeltext: alias
fieldname: alias
Labeltext: path
fieldname: path

What I dont get to work is working with the token because the token should be the ID and I need to get the title,alias and path for id 548 in table #####_menu. Thanks for the help. I appreciate it. It is a joy to work with chronoforms.
hennysmafter 08 Jul, 2013
Thanks everyone for the answers. I have posted the question above in a new topic so that it is easier for others to find.
hennysmafter 08 Jul, 2013
Dear Chronoform users and staff,

I am trying to make a form that allows my client to edit the mainmenu from the frontend. The client has publisher rights. He has Joomla 3.1 and Chronoforms V4.0

The form needs to connect to #####_menu and load all the records where menutype is mainmenu and the id is a specific id.

So basically for every menuitem I want to create a different form.

I have tried following the tutorials but they are not working. I have asked a question about this on the forum and received an answer thanks for that. But still the answer was not sufficient because according to the tutorial i should see an empty form but i did not. And for me it is important to keep my client happy and he wants this functionality as quick as possible.

So I ask the question now in a new topic. I hope someone can give me a good push in the right direction or can upload a form that does the same thing. Every joomla 3 installation has this table and table setup. I am 100% convinced that this is possible with Chronoforms because I have done these things before with Chronoforms only that was on Joomla 1.5 when I copy those codes used than I get an error.

Thank you for answers in advance.
GreyHead 08 Jul, 2013
Hi hennysmafter,

Please don't double post - it wastes your time and mine.

Your form seems to work correctly as far as it goes. You can remove the 1 from the WHERE statement if you are planning to identify the menu item using the form URL.

What exactly is the problem you have other than 'It doesn't work'?

Bob
hennysmafter 08 Jul, 2013
Sorry for the double post. I dont want to waste anyones time. When i remove the 1 i get error 1064 and when i replace the 1 for the id 548 then it still shows the first record in the table.
I use searchengine friendly urls but this is standard in joomla 3

These are the results i am getting:

With 1: title=Menu_Item_Root | alias=root | path=
With 548: title=Menu_Item_Root | alias=root | path=
With nothing: 1064 - 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 '' at line 1 SQL=SELECT * FROM `sjlgw_menu` AS `SjlgwMenu` WHERE

I need to get the following result
With 548: title=Homepage | alias=homepage | path=homepage

Hopefully this is enough information. If you want i can get you access to a test site and database.

EDIT:
I didnt understand the following "You can remove the 1 from the WHERE statement if you are planning to identify the menu item using the form URL."

But what you mean is:
index.php?option=com_chronoforms&tmpl=component&chronoform=test1&id=548

And now i see the result i want.
EDIT2:
And it saves aswell. I am going to double check now.
Yes it works with all menuitems. Superior solution. Thank you so much for this guidance.
yves-k 22 Aug, 2013
Hello hennysmafter

Did you solve your 1064 error ?
I have the same problem and browsing the forum it seems there is no real solutions !

Best regards
hennysmafter 21 Oct, 2013
I am so sorry for this extremely late reply. I hope that it still helps that I post it.
What solved it for me was the following:

index.php?option=com_chronoforms&tmpl=component&chronoform=test1&id=548

I explain:

Standard link [ index.php?option=com_chronoforms&tmpl=component&chronoform= ]

Then you add the form name [ index.php?option=com_chronoforms&tmpl=component&chronoform=THENAMEOFYOURFORM ]

Then you add the id or token or any other unique item that is relevant for the way you sort your records. In my case it was id [ index.php?option=com_chronoforms&tmpl=component&chronoform=THENAMEOFYOURFORM&id=001 ]

When you don't put in an id you get the 1064 error but with an id you get the correct results.



Today I needed to make another form and I received again the 1064 code but I fixed it with the above replies and comments. To make it easier for everyone I will create a bare minimal tutorial below:

This tutorial has the following items in the database:
DB Table = joomla_sometable
DB Table 'joomla_sometable' has 2 columns = id and name where id is always an unique value


Now inside chronoforms we create a form called test

1. In Preview: We create a textbox with label "name" and name "name"
2. We go to events and add a DB Record Loader and Show HTML event
3. We setup the DB Record Loader as follows.
- DB Field = "id"
- DB Table = "joomla_sometable"
- Request Param = "id"
DO NOT TOUCH ANYTHING ELSE!
4. Click on apply and save.
5. Save the form and click on 'Test Form'
6. You will receive the 1064 error. The address in the address bar should look something like this.
index.php?option=com_chronoforms&tmpl=component&chronoform=test

7. Now add to this address the following "&id=1", (you can change the 1 off course to any number that is in your database but becauses this is a test I only added 1 name to my DB.) This results in the following link:

index.php?option=com_chronoforms&tmpl=component&chronoform=test&id=1

8. Now you can see the form and the name that correspond with the id is now showing.
This topic is locked and no more replies can be posted.