Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Problem with LIKE in sql query

Featured Replies

SELECT jos_comprofiler.user_id, jos_users.email

FROM jos_comprofiler

WHERE jos_comprofiler.cb_music LIKE '%house%'

INNER JOIN jos_users

ON jos_comprofiler.user_id=jos_users.id

ORDER BY jos_users.email DESC

 

ok this is my query as it stands. the query works fine in my database without the Like part however when i put the LIKE part in i get the error

 

#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'WHERE jos_comprofiler.cb_music LIKE '%house%' INNER JOIN jos_users ON jos_comp' at line 2

 

Stuck on this one for a while now.

 

At the moment without that query im essentially pulling a list of all user IDs with a specific genre then cross referencing to another table to pull out the emails but without loading an array in php to create a list of user ids it becomes long winded.

 

Any suggestions

SELECT jos_comprofiler.user_id, jos_users.email
FROM jos_comprofiler
INNER JOIN jos_users
ON jos_comprofiler.user_id=jos_users.id
WHERE jos_comprofiler.cb_music LIKE '%house%'
ORDER BY jos_users.email DESC

Try that

  • Author

SELECT jos_comprofiler.user_id, jos_users.email
FROM jos_comprofiler
INNER JOIN jos_users
ON jos_comprofiler.user_id=jos_users.id
WHERE jos_comprofiler.cb_music LIKE '%house%'
ORDER BY jos_users.email DESC

Try that

 

Your a legend. Thank you that worked perfectly

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.