Topic RSS
5:38 pm
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
6:27 pm
March 6, 2005
Offline3:05 am
"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!
7:15 am
March 6, 2005
OfflineSorry, 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.
8:17 am
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!
8:25 am
March 6, 2005
OfflineI 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).
10:05 am
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
10:31 am
March 6, 2005
Offline6:10 pm
- 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
7:20 pm
March 6, 2005
OfflineHow 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?
8:43 pm
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
–
8:56 pm
March 6, 2005
OfflineThere 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.
Most Users Ever Online: 959
Currently Online:
82 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: 3549
Members: 1464
Moderators: 3
Admins: 1
Forum Stats:
Groups: 1
Forums: 4
Topics: 5157
Posts: 18387
Newest Members: juredujmovic, dreamkeeper, rajattyagi, wrokaa, lukass
Moderators: Paul (421), cnymike (8), sonika (95)
Administrators: Oliver (6398)
FAQs
Home
Add Reply
Add Topic
Quote











