[Plugin: Contact Form 7 to Database Extension] Warning: Invalid argument supplied for foreach()
-
I am getting an error in the backend when trying to retrieve data. here is the error: Warning: Invalid argument supplied for foreach() in /home/content/71/6793171/html/wp-content/plugins/contact-form-7-to-database-extension/ExportToHtmlTable.php on line 163
https://www.ads-software.com/extend/plugins/contact-form-7-to-database-extension/
-
The information is still in the database. I can see the tables and form name. for some reason the information being pulled from the database back to wordpress got messed up. How can I get the information to display again. The short codes are correct… Thank you
here is a screen shot: Screen Shot
Did you just upgrade to a newer version and this started?
no a girl at the office said she accidentally hit the delete column button so I was simply trying to revert to backup SQL. But I am still getting the error. The error has changed to line 325
here is line 325: foreach ($this->dataIterator->displayColumns as $aCol) {
Im sorry, she accidentally hit the add column button and typed in info and clicked send and the error appeared…
so what I am going to attempt to do is go into the database and look for any suspicious records or tables and delete.
anyway, shouldn’t just reverting back to backed up sql enough? Why is this not fixing the issue?
SQL queries on database: SELECT * FROM
wp_cf7dbplugin_submits
WHERE 1Fields:
submit_time
form_name
field_name
field_value
field_order
fileI dunno. My guess is, is that it is not in the database since I have already reverted twice to two previous versions. I’m lost…
where are the columns located at in the database? I think I found the issue. In the backend she had a bunch of nonsense columns created so I deleted most of them but it refuses to delete the remaining 3 bogus columns. So if I can locate these columns in the database and delete them that way it should be all good in the hood…
OK I am still on it. I found the error in the query that is being exported by the backend.
Query:
SELECT
submit_time
AS ‘Submitted’,
max(if(field_name
=’ML-Number’,field_value
, null )) AS ‘ML-Number’,
max(if(field_name
=’Notes’,field_value
, null )) AS ‘Notes’,
max(if(field_name
=’Sent a couple of follow up emails. LAst one is 11/27/11 if they respond w counter MArios’s highest is 45k. If its rejected subm’,field_value
, null )) AS ‘Sent a couple of follow up emails. LAst one is 11/27/11 if they respond w counter MArios’s highest is 45k. If its rejected subm’,
max(if(field_name
=’Sent Email requesting showing instructions Mario ”really wants property” . – pss 11/25/11′,field_value
, null )) AS ‘Sent Email requesting showing instructions Mario ”really wants property” . – pss 11/25/11’,
max(if(field_name
=’Status’,field_value
, null )) AS ‘Status’,
max(if(field_name
=’property-address’,field_value
, null )) AS ‘property-address’,
max(if(field_name
=’listing-agent’,field_value
, null )) AS ‘listing-agent’,
max(if(field_name
=’agent-phone’,field_value
, null )) AS ‘agent-phone’,
max(if(field_name
=’agent-email’,field_value
, null )) AS ‘agent-email’,
max(if(field_name
=’Asst’,field_value
, null )) AS ‘Asst’,
max(if(field_name
=’Submit-Date’,field_value
, null )) AS ‘Submit-Date’,
max(if(field_name
=’List-Price’,field_value
, null )) AS ‘List-Price’,
max(if(field_name
=’Bid-Amount’,field_value
, null )) AS ‘Bid-Amount’,
max(if(field_name
=’Deposit-AMT’,field_value
, null )) AS ‘Deposit-AMT’,
max(if(field_name
=’follow-up-date’,field_value
, null )) AS ‘follow-up-date’,
max(if(field_name
=’Submitted From’,field_value
, null )) AS ‘Submitted From’,
GROUP_CONCAT(if(file
is null or length(file
) = 0, null,field_name
)) AS ‘fields_with_file’
FROMwp_cf7dbplugin_submits
WHEREform_name
= ‘Untitled’
GROUP BYsubmit_time
ORDER BYsubmit_time
DESC
LIMIT 0,100The Bold is what I need to delete
I ran that query and got these results:
SELECT
submit_time
AS ‘Submitted’, max#if#field_na#e
=’ML-Number’,field_value
, null ## AS ‘ML-Number’, max#if#field_na#e
=’Notes’,field_value
, null ## AS ‘Notes’, max#if#field_na#e
=’Sent a couple of follow up emails# LAst one is 11/27/11 if they respond w counter MArios’s highest is 45k# If its rejected subm’,field_value
, null ## AS ‘Sent a couple of follow up emails# LAst one is 11/27/11 if they respond w counter MArios’s highest is 45k# If its rejected subm’, max#if#field_na#e
=’Sent Email requesting showing instructions Mario ”really wants property” # – pss 11/25/11′,field_value
, null ## AS ‘Sent Email requesting showing instructions Mario ”really wants property” # – pss 11/25/11’, max#if#field_na#e
=’Status’,field_value
, null ## AS ‘Status’, max#if#field_na#e
=’property-address’,field_value
, null ## AS ‘property-address’, max#if#field_na#e
=’listing-agent’,field_value
, null ## AS ‘listing-agent’, max#if(field_na#e
=’agent-phone’, […]MySQL said:
#1064 – 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 ‘s highest is 45k. If its rejected subm’,field_value
, null )) AS ‘Sent a coupl’ at line 4I run this query and all is OK:
SELECT
submit_time
AS ‘Submitted’,
max(if(field_name
=’ML-Number’,field_value
, null )) AS ‘ML-Number’,
max(if(field_name
=’Notes’,field_value
, null )) AS ‘Notes’,
max(if(field_name
=’Status’,field_value
, null )) AS ‘Status’,
max(if(field_name
=’property-address’,field_value
, null )) AS ‘property-address’,
max(if(field_name
=’listing-agent’,field_value
, null )) AS ‘listing-agent’,
max(if(field_name
=’agent-phone’,field_value
, null )) AS ‘agent-phone’,
max(if(field_name
=’agent-email’,field_value
, null )) AS ‘agent-email’,
max(if(field_name
=’Asst’,field_value
, null )) AS ‘Asst’,
max(if(field_name
=’Submit-Date’,field_value
, null )) AS ‘Submit-Date’,
max(if(field_name
=’List-Price’,field_value
, null )) AS ‘List-Price’,
max(if(field_name
=’Bid-Amount’,field_value
, null )) AS ‘Bid-Amount’,
max(if(field_name
=’Deposit-AMT’,field_value
, null )) AS ‘Deposit-AMT’,
max(if(field_name
=’follow-up-date’,field_value
, null )) AS ‘follow-up-date’,
max(if(field_name
=’Submitted From’,field_value
, null )) AS ‘Submitted From’,
GROUP_CONCAT(if(file
is null or length(file
) = 0, null,field_name
)) AS ‘fields_with_file’
FROMwp_cf7dbplugin_submits
WHEREform_name
= ‘Untitled’
GROUP BYsubmit_time
ORDER BYsubmit_time
DESC
LIMIT 0,100Results:
SELECT
submit_time
AS ‘Submitted’,
max#if#field_na#e
=’ML-Number’,field_value
, null ## AS ‘ML-Number’,
max#if#field_na#e
=’Notes’,field_value
, null ## AS ‘Notes’,
max#if#field_na#e
=’Status’,field_value
, null ## AS ‘Status’,
max#if#field_na#e
=’property-address’,field_value
, null ## AS ‘property-address’,
max#if#field_na#e
=’listing-agent’,field_value
, null ## AS ‘listing-agent’,
max#if#field_na#e
=’agent-phone’,field_value
, null ## AS ‘agent-phone’,
max#if#field_na#e
=’agent-email’,field_value
, null ## AS ‘agent-email’,
max#if#field_na#e
=’Asst’,field_value
, null ## AS ‘Asst’,
max#if#field_na#e
=’Submit-Date’,field_value
, null ## AS ‘Submit-Date’,
max#if#field_na#e
=’List-Price’,field_value
, null ## AS ‘List-Price’,
max#if#field_na#e
=’Bid-Amount’,field_value
, null ## AS ‘Bid-Amount’,
max#if#field_na#e
=’Deposit-AMT’,field_value
, null ## AS […]so my question remains. How do I manually delete field names?
OK, that is a test case I had not anticipated. Looks like the MYSQL gets bad because of quotes in the column name (“MArios’s”).
To manually delete the fields, in MySQL, first try a select:
select * from wp_cf7dbplugin_submits where field_name like 'Sent a couple of follow up emails%'
You should get all the rows that represent that bogus column and nothing more. Assuming that select is OK, run:
delete from wp_cf7dbplugin_submits where field_name like 'Sent a couple of follow up emails%'
Then do the same using ‘Sent Email requesting showing instructions%’
- The topic ‘[Plugin: Contact Form 7 to Database Extension] Warning: Invalid argument supplied for foreach()’ is closed to new replies.