Title: Empty array in getProjectMembers() causes SQL error IN ()
Last modified: September 23, 2026

---

# Empty array in getProjectMembers() causes SQL error IN ()

 *  Resolved [Horacio Figarella](https://wordpress.org/support/users/hfigarella/)
 * (@hfigarella)
 * [1 week ago](https://wordpress.org/support/topic/empty-array-in-getprojectmembers-causes-sql-error-in/)
 *     ```wp-block-code
       Hi LazyCoders team,Found in 1.7.63, and still present in SVN trunk: src/Controller/v3/Lazytask_ProjectController.phpTwo methods guard their input like this:php<br><br>// getProjectMembers(), line 379<br><br>if ($projectsId == '') {<br><br>// getProjectInvitedMembers(), line 3131<br><br>if ($projectsId == '') { return &#091;]; }<br><br>Since PHP 8, &#091;] == '' is **false**, so an empty array gets past the guard. The code then runs implode(', ', array_fill(0, 0, '%s')), which gives '', and the query ends in WHERE projectMembers.project_id IN (). That is a MySQL syntax error, logged as WordPress database error You have an error in your SQL syntax ... near ')'. We saw it about 10 times a day in our PHP error log before patching.getNoOfTasksByProject() (line 3177) already handles this correctly with a second check:php<br><br>if ($projectsId == '') { return &#091;]; }<br><br>if (is_array($projectsId) && sizeof($projectsId) == 0) { return &#091;]; }<br><br>**Suggested fix:** the same guard in the other two methods, or simply:php<br><br>if (empty($projectsId)) { return &#091;]; }<br><br>(empty() covers '', null and &#091;]. A project id of 0/'0' is not a valid id here anyway.)We've been running the empty() version on 12 sites (PHP 8.4 and 8.5) since 2026-09-18 with no side effects. It would be great to have it upstream so we can drop our local patch.Environment: WordPress 7.2-alpha (nightly), PHP 8.4.25 / 8.5.11, LazyTasks 1.7.63 plus premium, timetracker and whiteboard add-ons.Thanks!
       ```
   

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

 *  Plugin Contributor [Noor Khan](https://wordpress.org/support/users/nmkhan/)
 * (@nmkhan)
 * [1 week ago](https://wordpress.org/support/topic/empty-array-in-getprojectmembers-causes-sql-error-in/#post-19027974)
 * Hi,
 * Thank you for this. It’s one of the most useful reports we’ve received: exact
   file and line numbers, the root cause, a suggested fix, and a week of testing
   on 12 sites. That made it quick to act on.
 * You’re right about the cause. Since PHP 8, `[] == ''` evaluates to false, so 
   an empty array got past the guard in `getProjectMembers()` and `getProjectInvitedMembers()`,
   and the query ended with `IN ()`.
 * The fix is in **LazyTasks 1.7.67**, which goes out today. We also checked the
   rest of the codebase for the same pattern. Other lookups that build an `IN()`
   list from an array of IDs (projects, members, users, companies, and tasks) now
   use the same empty-input guard, so this error shouldn’t come up anywhere else.
 * After you update, you can remove your local patch. If anything similar shows 
   up in your logs on PHP 8.4 or 8.5, please send it over and we’ll look into it.
 * Would you be okay with us thanking you in the community post? We can keep it 
   anonymous if you’d rather.
 * Thanks again, and happy tasking!
   The LazyCoders Team
 *  Thread Starter [Horacio Figarella](https://wordpress.org/support/users/hfigarella/)
 * (@hfigarella)
 * [6 days, 20 hours ago](https://wordpress.org/support/topic/empty-array-in-getprojectmembers-causes-sql-error-in/#post-19028218)
 * Thanks for the quick fix in 1.7.67! Yes, you’re welcome to mention me by name(
   Horacio Figarella). Happy to keep reporting anything else we find on PHP 8.4/
   8.5.
 *  Plugin Contributor [Noor Khan](https://wordpress.org/support/users/nmkhan/)
 * (@nmkhan)
 * [6 days, 15 hours ago](https://wordpress.org/support/topic/empty-array-in-getprojectmembers-causes-sql-error-in/#post-19028616)
 * Thanks so much. We will greatly appreciate if you leave a review for us.

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fempty-array-in-getprojectmembers-causes-sql-error-in%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/lazytasks-project-task-management/assets/icon-256x256.png?
   rev=3143569)
 * [LazyTasks - Project & Task Management with Collaboration, Kanban and Gantt Chart](https://wordpress.org/plugins/lazytasks-project-task-management/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lazytasks-project-task-management/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lazytasks-project-task-management/)
 * [Active Topics](https://wordpress.org/support/plugin/lazytasks-project-task-management/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lazytasks-project-task-management/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lazytasks-project-task-management/reviews/)

## Tags

 * [Database Error](https://wordpress.org/support/topic-tag/database-error/)
 * [php 8](https://wordpress.org/support/topic-tag/php-8/)
 * [sql-error](https://wordpress.org/support/topic-tag/sql-error/)

 * 3 replies
 * 2 participants
 * Last reply from: [Noor Khan](https://wordpress.org/support/users/nmkhan/)
 * Last activity: [6 days, 15 hours ago](https://wordpress.org/support/topic/empty-array-in-getprojectmembers-causes-sql-error-in/#post-19028616)
 * Status: resolved