Hello there,
great product you have! How is it possible to change the data table after already connecting the form to a table?
Can I simply delete some columns via phpMyAdmin? How do I not loose data but edit the form e.g. delete a form field or change which fields get entered in the database table?
Sincerely,
moon
great product you have! How is it possible to change the data table after already connecting the form to a table?
Can I simply delete some columns via phpMyAdmin? How do I not loose data but edit the form e.g. delete a form field or change which fields get entered in the database table?
Sincerely,
moon
Hi moon,
You can edit both the table and the form. But at present you have to do it by hand and take some care! (Back up first!)
The important thing is to keep the form structure in MySQL and the Autogenerated code in ChronoForms lined up.
The default structure for Autogenerated code is like this:
Bob
You can edit both the table and the form. But at present you have to do it by hand and take some care! (Back up first!)
The important thing is to keep the form structure in MySQL and the Autogenerated code in ChronoForms lined up.
The default structure for Autogenerated code is like this:
<?php
lobal $database;
$database->setQuery( "INSERT INTO #__chronoforms_2 VALUES (
'' , '". date('Y-m-d')." - ".date("H:i:«»s"«»)."', '".$_SERVER['REMOTE_ADDR']."' , '".$_POST['name']."' , '".$_POST['email']."');" );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
It will probably help to re-write the query into a SET format like:<?php
global $database;
$sql = "
INSERT
INTO #__chronoforms_2
SET recordtime ='". date('Y-m-d')." - ".date("H:i:«»s"«»)."',
ipaddress = '".$_SERVER['REMOTE_ADDR']."' ,
name = '".$_POST['name']."' ,
email = '".$_POST['email']."');";
$database->setQuery( $sql );
if (!$database->query()) {
echo "<script> alert('".$database->getErrorMsg()."'); window.history.go(-1); </script>
";
}
?>
This makes it easier to add fields and be clear which form values are being assigned to them.
Bob
Thank you very much, I thought it would be more hard.
So all I have to do is delete column XXX via phpMyAdmin and delete " XXX = '".$_POST['XXX']."' from the autogenerated code.
Very quick reply!
So all I have to do is delete column XXX via phpMyAdmin and delete " XXX = '".$_POST['XXX']."' from the autogenerated code.
Very quick reply!
This topic is locked and no more replies can be posted.