skip to Main Content

I have a database emails that has crewEmails which contain email addresses. I’m trying to get all addresses that contain "comcast" in the address. Here’s the sql I’m using:

SELECT * FROM `emails` WHERE crewEmail like '%{"comcast"}%'

but this returns nothing. I absolutely have comcast email addresses in the database.

2

Answers


  1. Maybe you should try these SQL syntax, without double quotes around comcast :

    SELECT * FROM `table` WHERE `column` LIKE '%$word%'
    

    After fields and values substitutions :

    SELECT * FROM `emails` WHERE `crewEmail` LIKE '%comcast%'
    
    Login or Signup to reply.
  2. No need of brackets :

    SELECT * FROM `emails` WHERE crewEmail like '%comcast%'
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search