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
https://forums.phpfreaks.com/topic/125297-a-question-about-in-statements/
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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.