Jump to content


- - - - -

Eternalmart Form Processor


  • Please log in to reply
5 replies to this topic

#1 glen

glen

    Administrator

  • Admin
  • PipPipPipPip
  • 888 posts

Posted 18 February 2006 - 02:18 AM

Hi everyone,

I have been reinstalling an old form processing script called EternalMart Form Processor version 2.10

I have been having a few problems installing it and so I will list my fixes here:

1. Invalid default value for 'em_fieldid'
The first error I had occurred while setting up the MYSQL tables (using the emform.sql file):
ERROR

Quote

#1067 - Invalid default value for 'em_fieldid'
FIX - I got around this by downloading the table structure from another working copy. :)

[SEE THE ATTACHED TEXT FILE BELOW]

2. Cannot redeclare clear_parse()
ERROR

Quote

Fatal error: Cannot redeclare clear_parse() in /usr/home/www/public_html/coolsite/emform/library/class.fasttemplate.php on line 647
FIX
I got around this error by editing the file called class.fasttemplate.php as follows:

I commented out the following lines using // (two forward slashes before each line) -

Quote

// ************************************************************
// Aliased function - used for compatibility with CGI::FastTemplate
// function clear_parse ()
// {
// $this->clear_assign();
// }

Attached Files



#2 glen

glen

    Administrator

  • Admin
  • PipPipPipPip
  • 888 posts

Posted 18 February 2006 - 02:35 AM

also, in case anyone is looking for the original eternalmart form processor script i have attached it as a zip file.

Attached Files



#3 glen

glen

    Administrator

  • Admin
  • PipPipPipPip
  • 888 posts

Posted 18 February 2006 - 02:55 AM

I just create a form and the sql generated to create the relevant table is as follows:

Generated SQL :

Quote

CREATE TABLE em_contactus (
seq int(10) DEFAULT '0' NOT NULL auto_increment,
em_name text,
em_email text,
em_message text,
em_fileupload text,
submitdate datetime,
PRIMARY KEY (seq)
);
CREATE TABLE em_archive_contactus (
archive_seq int(10) DEFAULT '0' NOT NULL auto_increment,
seq int(10),
em_name text,
em_email text,
em_message text,
em_fileupload text,
submitdate datetime,
archiveddate datetime,
PRIMARY KEY (archive_seq)
);
However!!! I got the following error!

Quote

Can't create table.
Invalid default value for 'seq'

It seems that all that has to be done is to remove the reference to DEFAULT '0' and then cut and paste the fixed SQL query and run it using PHPMyAdmin or a similar database admin program.

#4 glen

glen

    Administrator

  • Admin
  • PipPipPipPip
  • 888 posts

Posted 18 February 2006 - 06:54 AM

I GIVE UP! For some reason the form validation step does not work and the scripts is useless. I think it must be something to do with the version of MySQL that is installed on my server. This script was written for an old version of MySQL.

oh well! I tried! (though gee it was a waste of time in hindsight!)

:(

The following text partly explains the problem with the more recent MySQL versions:


MySQL Bugs: #392: Problem With Auto_increment/Default Value in MySQL 4.1
Bug #392 Problem With Auto_increment/Default Value in MySQL 4.1 Submitted:7 May 2003 18:16 Modified: 1 Jun 2003 16:34 Status:Won't fix Severity:S3 (Non-critical) Lead:Bugs System Category:Server Version:4.1 OS:Red Hat 8.0 Changeset:


[7 May 2003 18:16] Timothy Crider Description:
When issuing a create statement in MySQL 4.1 and trying to make a default value
for the ID that is auto_increment, MySQL rejects the table as an invalid default
value for ID. My Configuration Information is as follows:

./configure --prefix=/usr/local/mysql \
--libexecdir=/usr/local/libexec \
--libdir=/usr/local/lib \
--includedir=/usr/local/include \
--enable-local-infile \
--with-unix-socket-path=/var/lib/mysql/mysql.sock \
--with-mysqld-username=mysql \
--with-vio \
--without-isam \
--with-openssl=/usr/local \
--without-innodb

If you need to see anything else, please let me know.

How to repeat:
SQL-query :

CREATE TABLE `a` (

`id` INT UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
PRIMARY KEY ( `id` )
) TYPE = MYISAM

MySQL said:

Invalid default value for 'id'

and
SQL-query :

CREATE TABLE `a` (

`id` INT UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
PRIMARY KEY ( `id` )
) TYPE = MYISAM

MySQL said:

Invalid default value for 'id'

AND

SQL-query :

CREATE TABLE `b` (

`my_id` INT UNSIGNED DEFAULT '0' NOT NULL AUTO_INCREMENT,
PRIMARY KEY ( `my_id` )
) TYPE = MYISAM

MySQL said:

Invalid default value for 'my_id'
Back


[8 May 2003 21:03] Miguel Solorzano Thanks you for the bug report.

The behavior of 4.1.XX is different than 4.0.XX and 3.23.XX when is used
the default value with an auto_increment column.
This was added with the changeset: 1.1494.38.1 2003/03/26

/sql/sql_parse.cc

if (default_value)
{
.....
#ifdef MYSQL41000
else if (type_modifier & AUTO_INCREMENT_FLAG)
{
net_printf(&thd->net, ER_INVALID_DEFAULT, field_name);
DBUG_RETURN(1);
}
#endif

So the bug should be:

1- Isn't documented that typing a default value for auto_increment column
isn't more supported on servers 4.1.XX.
2- The message error isn't well descriptive.


[1 Jun 2003 16:34] Michael Widenius Thank you for your bug report. This issue has been addressed in the
documentation. The updated documentation will appear on our website
shortly, and will be included in the next release of the relevant
product(s).

I have now updated the CREATE and upgrading to 4.1 manual sections about this.

[28 Apr 2005 4:07] LifeNT koson
the auto_increment colum can only accept default value as "default
null",yeah,can only accept "null" as default value,all the other value is not
invalied. http://bugs.mysql.com/bug.php?id=392

#5 node

node

    New Member

  • Members
  • Pip
  • 1 posts
  • Gender:Male
  • Location:London

Posted 20 January 2007 - 08:58 AM

Hi everyone,

I just create a new form, I have correct database, I can edit created form, almoust everything is ok. but when I'm clicking on crated link I have blank page, what is not correct ?

#6 glen

glen

    Administrator

  • Admin
  • PipPipPipPip
  • 888 posts

Posted 20 January 2007 - 07:24 PM

hi node, sorry i am not sure what is going wrong there. i am still using this script on one of my sites and it is working. though as you can see from above i had quite a few problems getting it going. if i was starting out fresh i would probably try to use another script that provides support. its a shame the eternalmart people disappeared. they made good scripts.

cheers, glen




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users