Gideon7
Forum Replies Created
Viewing 3 replies - 1 through 3 (of 3 total)
-
Wonderful, and thank you so much for the fast response.
Forum: Plugins
In reply to: [WP Db Abstraction] [Plugin: WP Db Abstraction] Database Update IssuesTo handle NULL cases use ISNULL(meta_value,”), like this:
SELECT COUNT(CASE WHEN ISNULL(meta_value, '') LIKE '%"administrator"%' THEN 1 ELSE 0 END) as Computed, ...Forum: Plugins
In reply to: [WP Db Abstraction] [Plugin: WP Db Abstraction] Database Update IssuesI get the same error on a fresh install of WordPress 3.4.1 on IIS 7.5 with SQL Server 2008 R2. Whenever I try to add a new user I get:
WordPress database error: [[Microsoft][SQL Server Native Client 11.0][SQL Server]Incorrect syntax near the keyword 'LIKE'.] SELECT COUNT(NULLIF(meta_value LIKE '%"administrator"%', false) as Computed), COUNT(NULLIF(meta_value LIKE '%"editor"%', false) as Computed), COUNT(NULLIF(meta_value LIKE '%"author"%', false) as Computed), COUNT(NULLIF(meta_value LIKE '%"contributor"%', false) as Computed), COUNT(NULLIF(meta_value LIKE '%"subscriber"%', false) as Computed), COUNT(*) as Computed FROM wp_usermeta WHERE meta_key LIKE 'wp_capabilities'The problem is that naked boolean expressions are not allowed inside of a function. The above needs to be re-written to use a numerical expression:
SELECT COUNT(CASE WHEN meta_value LIKE '%"administrator"%' THEN 1 ELSE 0 END) as Computed, COUNT(CASE WHEN meta_value LIKE '%"editor"%' THEN 1 ELSE 0) as Computed ...
Viewing 3 replies - 1 through 3 (of 3 total)