can't create table

thomas 24 Aug, 2008
Hi,

I encounter a problem when I try to create a table for a form. The browser just gives a blank screen and no table is created.... On mij own testserver this function works fine, and I've tried copying the table from my testsite to my website but this doesn;t work either, Chronoform sees that there is a table but won't write data to it.

I use J1.5.6 and Chronoform v3.0

My provider isn't very helpfull, they just tell me that a lot of their users use Joomla without problems....

Does anyone here have a clue?

Thanks in advance!
Max_admin 24 Aug, 2008
Hi Thomas, so you get the fields list screen first then when you click "save table" it does the blank screen ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
thomas 24 Aug, 2008
Hi Max,

When I create a form, and then click on create table I get the screen where I can select which columns to create, I select all and click create table, then I get a completely blank screen. The source of the blank page is this:

<script> alert('You have an error in your SQL syntax near 'ENGINE = MYISAM ' at line 1 SQL=CREATE TABLE `jos_chronoforms_2` (`cf_id` INT( 11 ) NOT NULL AUTO_INCREMENT , `uid` VARCHAR(255) NOT NULL, `recordtime` TEXT NOT NULL , `ipaddress` TEXT NOT NULL ,`text_1` LONGTEXT NOT NULL , `undefined` LONGTEXT NOT NULL , PRIMARY KEY ( `cf_id` )) ENGINE = MYISAM ;'); window.history.go(-1); </script>

Could this be a problem with my SQL version? My SQL database in my testwebsite creates a SQL export script that the SQL database of my website doesn't like. It gives errors, the errors stop when I remove this part form the end of the CREATE TABLE part:

) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=77 ;

Could this be the same problem?
Max_admin 24 Aug, 2008
Hi Thomas,

aha, you have V3 BETA 1 then ? not BETA 2 ? do you have forms setup yet ? if not then get the BETA 2, its better with DB handling but your issue may stay the same, however BETA 2 shows the error in a better way!(you can upgrade without losing your forms, check our download page)

back to you error, at the form edit page which you are trying to create the table for, near the bottom of the general tab, you will find Mysql type, its Engine or Type, make it "Type" instead of "Engine" and I think this will fix it for you!🙂

Cheers

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Max_admin 24 Aug, 2008
my last point can be applied to both BETA 1 and 2
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
thomas 24 Aug, 2008
Tanks for the advice! That got me a bit further. I can now create a table for my form and the form works well enough, for now it sends me an e-mail after it was submitted and for a user it looks like everything is OK. But the data doesn't get saved in the database that was created...

My guess is that the following problem still exists:

In DB Connection it say's: enable data storage: no

but I can't change it because of the following problem: When the table is created it is only once possible to change its properties. After that when I try to change anything it gives a 500 internal server error. I tried changing things in PhpMyAdmin and that worked for other settings but I can't find this setting in the database, and it's not very userfriendly to have to use phpmyadmin all the time, so.... the real problem is that I can't change any properties.

My php version is really old (MySQL 3.23.58-log) do you think this is the problem?

Thanks for all your advice and sorry for troubling you with this!
Max_admin 25 Aug, 2008
Hi Thomas,

I cant understand, why you can set DB connection to YES ? and what are the table properties you can't change ? create another table ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
thomas 25 Aug, 2008
Ho Max,

Sorry I didn't make myself very clear in my last post. My problem is now that when I have created a form and click on its name in the forms management page, I do get the right page where I can adjust settings (like DB connections) but when I click save I gives an internal server error and no changes are saved. However when I've just created a form it does this ok the first time, so I can change things once, after that it starts giving this error.

I can make some changes with phpmyadmin, but I can't find all the options there.... and some other people that don;t know anything about SQL and php also have to use it.
Max_admin 25 Aug, 2008
Hi Thomas,

ok, remove any code in the "form code" tab fields, and then save when they are all blank, you still get the internal server error on save ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
thomas 25 Aug, 2008
Hi Max,

Thanks for your patience withg this, the problem stay's the same when I remove everything for those fields
Max_admin 25 Aug, 2008
Hi Thomas,

Ok, remove the code in the autogenerated tab and disable DB connection if any of those happens and then test again ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bandbreed 10 Sep, 2008
Sorry to bump this thread but I am experiencing the same problem and do not want to open a new one so here goes.

I just installed the Chronoform and made a large form and everything goes perfect until I create a table for that form. When I do that it generates some code in the Autogenerate tab and if I leave it there, I get an internal server error back whenever I try to change something in the form from within Chronoform, in the form code or wherever. Strangely enough, the form itself on the site works completely and does generate reports in the database table.

Problem is that from time to time I _do_ want to change something and the only possible solution now would be to copy the database and edit it just before creating a table for it, or remove the autogenerate tags, but that breaks the link to the database and it won't store user input that way.

So I was wondering if there is something I can do to fix this problem because I am not too happy with the workaround at the moment and I hope you have a solution.

Yours truly,

Arne.
Bandbreed

P.S. I changed the installation fron 2.5 tot Beta 3 v2 and now it does write to the database but I have to manually remove the autogeneration data everytime I do an update, still not perfect and with Beta I have the link below which is the reason I bought the component in the first place... Any help still appreciated.
Max_admin 10 Sep, 2008
Hi bandbreed,

we send a license for BETA 2, just email me your payment details please!

let do this, create a new form with one field only and give it the name "email"

create a table for this form and just choose the default fields available!

connect your form to this table and save it.

open your form again and try to change anything like enabling validation or so, away from changing any code, do you get the same issues ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bandbreed 11 Sep, 2008
I'll send you the payment details through the mail later this day. I'd like to have a licenced version of the Beta.

I tried creating a new Form and added just one field, with this code:

<input name="email" type="text" />


I could save it but somewhere before I created a table it Autogenerated the PHP code and at that time it goes wrong. I can delete the AutoGenerated code and then it does work so my best guess is that somehow the code does not work well together with the site. I have my administrator have a look at it but he had too little time to dig into the code to have a good guess. This is the generated code for the email form:

<?php
		if($paramsvalues->dbconnection == "Yes"){			
			$row =& JTable::getInstance("", "Table");
			srand((double)microtime()*10000);
			$inum	=	"I" . substr(base64_encode(md5(rand())), 0, 16);
			$_POST["recordtime"] 	= JRequest::getVar( "recordtime", date("Y-m-d")." - ".date("H:i:s"), "post", "string", "" );
			$_POST["ipaddress"] 	= JRequest::getVar( "ipaddress", $_SERVER["REMOTE_ADDR"], "post", "string", "" );
			$_POST["uid"] 	= JRequest::getVar( "uid", $inum, "post", "string", "" );
			$post = JRequest::get( "post" , JREQUEST_ALLOWRAW );			
			if (!$row->bind( $post )) {
				echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
				exit();
			}				
			if (!$row->store()) {
				echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
				exit();
			}			
		}
		?>


and this is the error that shows whenever I try to save, or even cancel a modification to the form:

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, ****@bandbreed.nl 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.


I would really like to fix the error. Hope you can help or have another solution.

Thanks in advance!
Max_admin 11 Sep, 2008
Hi,

so the first time you save it it goes fine then on any edit it just gives the error ?

try to remove those lines from the autogenerated code:

if (!$row->bind( $post )) {
            echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
            exit();
         }            
         if (!$row->store()) {
            echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
            exit();
         }   


will it save fine on edit now ?

btw, simply removing the code everytime before saving will not affect anything as the code is auto generated everytime also, 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.
Bandbreed 11 Sep, 2008
I can create a new form, but as soon as I change something in one of the tabs it generates the PHP code in the AutoGenerate tab and then it becomes impossible to save, apply or even cancel, I have to remove all the PHP code right before saving to get any changes done.

I also tried your code in the AutoGenerate field but that also gave back an internal server error. I have no idea what it could be but I am happy to say that the project is newrly finished so I would not give it a high priority on your side, if you do happen to find a solution I would love to hear it because I am going to use your forms a lot more in the near future. Thanks in advance.
Max_admin 11 Sep, 2008
that's fine but I'm interested to know why, so, if you got a minute try to delete this code line by line and see if it will get solved after deleting a particular line ?
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bandbreed 11 Sep, 2008
Okay, let me give it a go...

I think I got something... in this bit of code we found the problem:

			if (!$row->bind( $post )) {
				echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
				exit();
			}				
			if (!$row->store()) {
				echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
				exit();
			}


I started stripping the lines but found that both if statements return the error and after some deleting of bits we found that it falls over the </script> part, if you remove both tags and leave the rest intact it works, or at leasts saves the updated form.

Could you edit the Autogenerator-generator for me so it gives me a piece of code without the </script> bits? that would make my day.
Max_admin 11 Sep, 2008
sure, replace those <script> lines and the exit() one too :
echo "<script> alert('".$row->getError()."'); window.history.go(-1); </script>\n";
            exit();


with this in both occurrences :

JError::raiseWarning(100, $row->getError());


let me know!
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
Bandbreed 11 Sep, 2008
Yes, that does work, but now I need to edit the generator itself because every time I open a form, it automatically generates new code which has the old "error" in it. Can you point me to the place where I can hard-code the replacement lines in the generator?
Bandbreed 12 Sep, 2008
Great, that works! Any idea why the other code gives those problems? I am sure other people do not have those troubles with the same code so I guess it has something to do with our server and or database? Anyway, thanks a lot for your dedication and effort in this. I'll write you my payment details soon for the licenced version of the Beta and when I get around I'll write a nice testemonial for Chronoforms.

Thanks again.
Max_admin 12 Sep, 2008
Hi bandbreed, thank you, well as you said, different server config, we try to reach to the most common and safe solution!🙂

regards

Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.

VPS & Email Hosting 20% discount
hostinger