FaaPz/PDO

Variable isn't countable

Closed this issue · 3 comments

https://github.com/FaaPz/Slim-PDO/blob/d6c82ddc50480f58404647f79ec60d2459ccc078/src/PDO/Statement/StatementContainer.php#L514

I sometimes get an error from this line, because $value isn't a countable variable. I changed it to 1 for now to get around it.

The error is:

PHP Warning:  sizeof(): Parameter must be an array or an object that implements Countable in /Users/stevevance/Sites/Chicago Cityscape/vendor/slim/pdo/src/PDO/Statement/StatementContainer.php on line 514

My query looks like this:

$fields = [
			"pin", 
			"city",
			"address",
			"township",
			"property_description_16 AS property_description",
			"property_class_16 AS property_class",
			"property_class_15 AS property_class_15",
			"property_description_15 AS property_description_15",
			"ST_AsGeoJSON(ST_Transform(ST_ForceRHR(geom), 4326), 5) AS geojson"
		];
$statement = $pdo->select($fields)
							->from("property_parcels_table")
							->whereIn('pin', $this->pins);

Oh I see #105
Project is dead

kwhat commented

Not dead, 1.x maybe dead, and this is only an issue with 1.x code. 2.x is nearly done so please migrate.

kwhat commented

This was just fixed in #117