Query builder doesn’t support columns with spaces in the name
-
Trying to join tables to get user full name information in a report, using following SQL:
select wp_2_time_entry.*, wp_users.*, wp_usermeta.* from wp_2_time_entry
inner join wp_users
on wp_2_time_entry.WP_UserID = wp_users.ID
inner join wp_usermeta
on wp_usermeta.user ID
= wp_users.idError message returned:
Unknown column 'wp_usermeta.User Id' in 'on clause'
Adding backticks around wp_usermeta returns this error:
Unknown column 'wp_usermeta.User Id' in 'on clause'
Removing the backticks around
user ID
returns this error:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'id = wp_users.id limit 100' at line 5
‘User Id’ appears to definitely be the correct column name for user IDs in usermeta.
Are there any workaround for this?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.