Hi zendiko,
Yes, it's possible but will require a little hand-code I think. The SQL will be something like
DELETE FROM `#__table_name` WHERE cf_id = `99`;
You'll need to build this up in one of the OnSubmit boxes I think.
Bob
I attempted to try something like this by looking at a previous post on a similar section however I was placing the code in the From Code -> On Submit code - before sending email window and I was getting an error when I was trying to save the form...
When I hit save, I get this:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, [email]webmaster@clients.zendiko.com[/email] and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Any Ideas?
Thanks Much!
Aaron
Alright...
I've narrowed it down... The error is coming from the table name... if i take jos_chronoforms_Newletter out of the sql query it saves... if i have anything as a table name I get that error... hmmm... any ideas?
Hi zendiko,
The error you've posted just says that your site doesn't appear to have a 500 error page. The 500 error is a server error - I've no real idea why this should happen with a database query.
The SQL you have there looks OK, it's missing a final ; and isn't fully quoted but should run OK (I just tested it here on my local server).
The next step is to open up PHPMyAdmin or something similar and paste the SQL directly into the query box. Then you can see any error messages without any Joomla stuff getting in the way.
Bob
I logged into PHPmyadmin and successfully completed the SQL statement... I had 3 entrees with that email and it deleted all 3.
hmm... the form program just won't let me post that table name into the onSubmit after email textarea...
-Aaron
Maybe Max can give more insight? or someone? You think it's a server issue or a component/chrono issue?
I posted that code into the "On Submit code - after sending email:" section and I went to save it and got the Internal Error Again!
Yikes!
Still the same error upon saving... there is one thing that I changed upon setting up the database... not sure if this would cause any harm... but when I created the form I accidently spelled it "Newletter" instead of "Newsletter" so when the table was made... it was called jos_chronoform_Newletter... and I later changed the form name to Newsletter. I thought... well maybe that was causing it... so I changed the form name back to Newletter and the error became worse! After it would not allow me to save I would hit back and normally I would hit Cancel to get back to the main Chronoform admin, but when I did that I got the error again as well... so I changed the form name back to Newsletter and it still has the error on the save but not on the cancel...
does that help at all? Maybe I should Just start the form and database over?
-Aaron
Also, I just purchased the licensing and if the new install is not any kind of upgrade, i'd rather not have to re-install. So when you get a chance, Bob, could you send me the directions on how to take off the backlink?
Thanks!
Aaron
Hi Aaron,
first, back to your saving error problem, what if you removed all code from the onsubmit code area, all is fine ? if so then add your code and delete all lines except the php tags, then save, then add one more line, and so, until you find where the problem is! I can't see where the problem is in your code, its working here fine so it must be because of some config at your server.
the license email I sent has all info needed, tell me if there is anything not clear enough.
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max,
In the previous posts I mentioned that whenever I place the table name jos_chronoform_Newletter I get that error... but if i leave everything and just delete the name of the table it will save...
Aaron
Hi Aaron, then replace jos_chronoform_Newletter in your code with #__chronoform_Newletter
let me know!
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
OK...
I got it to save: $sql = "DELETE #__chronoforms_Newletter WHERE email=$email";
but when I add "FROM" after DELETE it gets the error.
Any ideas?
Aaron
Thanks for your help! I appreciate it!
Hi zendiko,
One of my replies seems to have gone missing here. I'll try and repeat it.
The code you posted is not valid SQL so I'm not quite sure what it is doing, probably nothing.
It's always difficult to diagnose by posting here; and nearly impossible unless you post both the code you are using and the *exact* error messages.
It looks as though you have not followed the advice on quoting the SQL; you have not added the missing ; from the end of the statement and you have not added the code to display the sql (or if you have then you haven't posted the results).
Have you followed Max's suggestion of removing the code and replacing it line by line?
Bob
Hi zendiko,
Well 'DELETE FROM' isn't valid anything - not PHP and not SQL. It's odd that it crashes your server though, I'd expect a PHP error message.
I don't have time to look more closely not, but will try to take a look right through the code this afternoon.
Bob
I think I should just kill the component and reinstall everything... What do I need to install... because I never installed the mambot.. and I dont even know what that is... all I installed was the v3 component and the module.... and that is giving me trouble as well.
If you can just quickly jot down what I was supposed to do, I will blow it all out and start over.
Thanks,
Aaron
Hi Aaron,
before you go far, try to delet all your onsubmit code and keep the $db line with the SQL line and test, you have lots of code there and it may be causing some problem.
Regards
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
That code did not help... while it is probably correct... I still am unable to save without that server error... so I am sure that it is not a coding error... what do you think... scripting/setting error or server error?
Hi zendiko,
did you try my suggestion above ?
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Yes I did. It appears it is the "FROM" code now that is causing it.
Hi zendiko,
I'm as certain as I can be that FROM is not *causing* the problem. More likely removing the FROM makes the SQL Invalid and creates a different problem.
Please check that the table name is *identical* in spelling and upper/lower case in your database and in the SQL. That is both are "jos_chronoform_newletter", not "jos_chronoform_Newsletter" or any other version.
Bob
I have attached a picture of my database to verify spelling... remember I tested my SQL statement in phpmyadmin and it worked.... so obviously the SQL statement is correct.
[attachment=0]Picture 11.jpg[/attachment]
Hi zendiko,
That all looks good.
Have you output the SQL from ChronoForms (see one of my earlier posts) and tested that in PHPMyAdmin with cut and paste?
Bob
HI zendiko,
I was just checking that you actually entered the code to echo the sql to the screen and copy and paste it from there - can give different results than copying from the code in the OnSubmit box.
If that's so - then I have no idea what is happening here.
If the site is On-line, then by all means pm me with a SuperAdmin login and I'll go take a look.
Bob