Title: Invalid argument error
Last modified: August 18, 2016

---

# Invalid argument error

 *  [barrydt](https://wordpress.org/support/users/barrydt/)
 * (@barrydt)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/)
 * When I go to my Cystats page (I just installed it this afternoon), I see the 
   first 5 sets of stats (through ‘this year’s visits), and then I get the following
   error message:
 * Warning: Invalid argument supplied for foreach() in **/hsphere/local/home/_username_/
   trowbridgefamily.net/WP/wp-content/plugins/cystats/includes/view.class.php** 
   on line **516**
 * Any idea what might be causing this?

Viewing 6 replies - 1 through 6 (of 6 total)

 *  [kendreague](https://wordpress.org/support/users/kendreague/)
 * (@kendreague)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/#post-641151)
 * I have the same issue;
 * Warning: Invalid argument supplied for foreach()in /home/…../wp-content/plugins/
   cystats/includes/view.class.php on line 516
 * so I’m also seeking a solution
 *  [cywhale](https://wordpress.org/support/users/cywhale/)
 * (@cywhale)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/#post-641465)
 * Hello.
    I’m the author of cystats.
 * Bug 1: CyStats does not check if data array is filled with data before entering
   the display loop so you get this error message. I will fix that and inform you
   in this thread about the uploaded fixed version.
 * But: The message also means that the array of stored single-hit-data in the database
   table yourprefix_TABLE_STATISTICS_RAW is empty. The table should be filled with
   at least one entry from the installer.
 * – What WP version do you use?
    – If possible – can you look into phpmyadmin (
   or similar) if the table really is empty? – On CyStats->Clients: Do you receive
   data about browsers, os,… or empty tables/error messages?
 * Greets
    Cy
 *  [cywhale](https://wordpress.org/support/users/cywhale/)
 * (@cywhale)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/#post-641466)
 * Array-check-fix is online along with some new features of the developement version:
   
   [http://wordpress.org/extend/plugins/cystats/download/](http://wordpress.org/extend/plugins/cystats/download/)
   via ‘Developement version’.
 * What remains is that this database table definately should not be empty…
 *  [jaguanamidori](https://wordpress.org/support/users/jaguanamidori/)
 * (@jaguanamidori)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/#post-641518)
 * I was having this same problem too. I’ve downloaded the patch V0.8.8, installed
   it and activated it.
 * I get (on the CyStats Options page):
    CyStats visits table entries: 0 CyStats
   first database entry: 01.01.1970, 00:00 CyStats visits table last cleanup: December
   31, 1969 5:00 pm
 * wp_TABLE_STATISTICS_RAW and WP_TABLE_STATISTICS both exist and are BOTH EMPTY.???
 * Of course, there is no logging info either.
    Any suggestions?
 *  [cywhale](https://wordpress.org/support/users/cywhale/)
 * (@cywhale)
 * [18 years, 5 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/#post-641524)
 * Hrmpf. I should definately look into this forums more often, sorry. This evening
   I’ll try to track down this bug using a clean 2.3.1 install on my localhost. 
   I still have no idea why the tables are empty.
 * Question – does cystats work properly as soon as you have called some blog page
   1 or 2 times ? This has been reported by another user. As soon as the first entries
   went into the database everything was fine.
 *  [cywhale](https://wordpress.org/support/users/cywhale/)
 * (@cywhale)
 * [18 years, 4 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/#post-641525)
 * Released 0.8.9, should be in WordPress plugins svn in a few minutes, maybe the
   error was a wrong variable initialization like mentioned in [this thread](http://wordpress.org/support/topic/143444?replies=3).

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘Invalid argument error’ is closed to new replies.

 * 6 replies
 * 4 participants
 * Last reply from: [cywhale](https://wordpress.org/support/users/cywhale/)
 * Last activity: [18 years, 4 months ago](https://wordpress.org/support/topic/invalid-argument-error-1/#post-641525)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
