Jump to content

A question about in statements


suohryu

Recommended Posts

Hi all i been looking all over the web for a answer and failed at it so i thought ill asked the question in case it has never come up

 

so i have a php/sql query that looks like so

$quicksearch = "6168,6123,6132"

SELECT * FROM `coupons` WHERE `codes` IN ($quicksearch)

 

now i have a field in the coupon table with the value

6126,6168

 

now if i change the above $quicksearch to look for 6126 instead of 6168 it return the field but the code above returns 0 is there some way to implement a Like clause into the above so that it will return the field

 

look forward to the replies

Link to comment
Share on other sites

thanks for the reply... would you be able to explain the idea a bit for me and maybe a simple example would be wonderful because i think i understand what your saying but not 100% sure

 

are you saying i need to explode the code field for each result i have

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.