Jump to content

Search for results in a php array?


EchoFool

Recommended Posts

Hey,

 

I'm trying to create a search system where by fields have a number in them but my php carries an array of numbers.

 

So lets say a field holds the value 3.

 

And my php array is  1,3,5,8,9

 

How can i simply query to check if the number in the field is found in the php array ?

 

Link to comment
https://forums.phpfreaks.com/topic/238511-search-for-results-in-a-php-array/
Share on other sites

okay well i store numbers in database like 1,2,3,4,5 in a single field.

 

then i explode the string $var =  explode(',',$string);

 

so now i got the array as $var then i need to find all rows with field "test" containing a number that is found in array $var.

 

in_array cannot be done in a query from what im aware of?

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.