cforms II User Forum

Registration is currently disabled.
Guest

FAQs

Login form protected by Login LockDown.


Lost password?
Advanced Search

— Forum Scope —

  

— Match —

   

— Forum Options —

    

Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS
Tracking/Database Problems
May 22, 2007
5:38 pm
Vitaliy
Guest

I would like to enable the tracking feature, but the plugin cannot create the extra tables in my database for some reason. I get this error message when I try to enable the tracking feature:

 

WordPress database error:
[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 'CURRENT_TIMESTAMP, email varchar(40) default '', ]
CREATE TABLE wp_cformssubmissions (
id int(11) unsigned auto_increment,
form_id varchar(3) default '',
date timestamp NOT NULL default CURRENT_TIMESTAMP,
email varchar(40) default '',
ip varchar(15) default '',
PRIMARY KEY (id) )

Warning: array_search() [function.array-search]: Wrong datatype for second argument in /homepages/28/d126493713/htdocs/realestateshortsales /wp-admin/upgrade-functions.php on line 855

Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/realestateshortsales /wp-admin/upgrade-functions.php on line 864

 

Can anyone please tell me what the two database tables need to include so I can manually insert them, or is there another way I should be doing this?

Thanks

Vitaliy     

May 22, 2007
6:27 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline
May 23, 2007
3:05 am
Vitaliy
Guest

"It seems like your MySQL server (version?) doesn’t like the
“CURRENT_TIMESTAMP” default value. You can go into the php file and
remove that part (’default CURRENT_TIMESTAMP’) of the statement and it
should work."

 

I'm sorry, but I'm not quite sure where to find this value. I have looked everywhere for it but have only found this: the cforms plugin php file has 2 "current_time('timestamp')"

Which should I remove, if any? 

 

Thanks for your awesome help! This is an amazing plugin! 

May 23, 2007
7:15 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Sorry, I should've pointed you to the FAQ's instead, there is a bit more detailed desciption on what to do.

Essentially, you need to edit cforms-global-settings.php

Find the first CREATE TABLE statement (top of the file) and remove 'default CURRENT_TIMESTAMP'.

That should do it. 

May 23, 2007
8:17 am
Vitaliy
Guest

Great! Thanks Oliver! That fixed the tracking issue, but I got these warnings: 

 

Warning: array_search() [function.array-search]: Wrong datatype for second argument in /homepages/28/d126493713/htdocs/realestateshortsales/ wp-admin/upgrade-functions.php on line 855

Warning: Invalid argument supplied for foreach() in /homepages/28/d126493713/htdocs/realestateshortsales/ wp-admin/upgrade-functions.php on line 864

 

Is this something I should concern myself with?

Thanks! 

May 23, 2007
8:25 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

I take it that the tables have been created fine?

Have you tried submitting a form, is it writing to the tables?

If this error only appeared once (after enabling "DB tracking") I wouldn't worry about it, if you see this error all the time, something is not right and you should take a look at how the tables were in fact created in the WP DB (use phpMyAdmin or such). 

May 23, 2007
10:05 am
Vitaliy
Guest

Oliver,

Thanks for shooting over that email. Everything is working perfect and I never even had to edit the plugin php file. No errors and very neat new features! Tables have been created and the tracking is working!

I will let you know if I find any bugs in the future!

 

Vitaliy 

May 23, 2007
10:31 am
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

Excellent! Thanks for the follow-up!

August 14, 2007
6:10 pm
JohnMarkT
Guest
  • browser: Firefox 2.0.0.6
  • cforms version: 5.30
  • Wordpress version: 2.2.2

When I download a CSV or TAB formatted file of the tracking data, the fields in one of the entries is in reverse order. For example:

Form: contact 8/13/2007 20:19 CA Los Angeles Bob Thomas  
Form: contact 8/12/2007 17:23   John Smith New York NY
Form: contact 8/12/2007 17:16   Suzi Jones Chicago IL


Any idea what could be causing this?

-John Mark

August 14, 2007
7:20 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

How is it being displayed on the Tracking page per se?

The MySQL SELECT statment for download is:

SELECT * FROM…

so the order of fields is determined by how they were saved to the DB in the first place.  Consequently, the initial INSERT statement does provide the order in which fields are being stored (top->down)…could it be a server hiccup?

 

August 14, 2007
8:43 pm
JohnMarkT
Guest

It displays correctly on the Tracking page. I thought it could be a server hiccup originally, but it's done it a couple of times. Is there any ORDER BY in the query?

-John Mark

-- 

August 14, 2007
8:56 pm
Oliver
Munich, Germany
Admin
Forum Posts: 6400
Member Since:
March 6, 2005
Offline

There is, but not on the fields per se. Search for this line in cforms.php (~130):

            $sql = "SELECT *, form_id FROM {$wpdb->cformsdata},{$wpdb->cformssubmissions} WHERE sub_id in ($sub_id) AND sub_id=id ORDER BY sub_id DESC"; 

and replace it with:

            $sql = "SELECT *, form_id FROM {$wpdb->cformsdata},{$wpdb->cformssubmissions} WHERE sub_id in ($sub_id) AND sub_id=id ORDER BY sub_id DESC, f_id ASC";

see if that works. 

August 14, 2007
9:08 pm
JohnMarkT
Guest

That fixed it.

Thanks for a quick response and an overall excellent plugin!

-John Mark

--

Forum Timezone: Europe/Berlin

Most Users Ever Online: 959

Currently Online:
24 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

tracedef: 43

mores: 21

Gyrus: 20

frozenwaste: 18

asuffredini: 15

photoworks: 14

Member Stats:

Guest Posters: 3757

Members: 1463

Moderators: 3

Admins: 2

Forum Stats:

Groups: 1

Forums: 4

Topics: 5355

Posts: 18732

Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass

Moderators: Paul (421), cnymike (8), sonika (95)

Administrators: Oliver (6400), Nicky (3)