Bit of PHP/SQL help please?

Soldato
Joined
14 Apr 2003
Posts
4,950
Location
Deepest Yorkshire
Hi, I'm trying to select all rows from a database where a field on a row contains any of the characters in an array, is this possible?

for example $groups = "7 8 9"

I explode($groups, " ") to create an array

then try and get the right rows out the database with something like

$query = "SELECT * FROM quizes WHERE group LIKE '%$groups%'";

however firstly this doesn't work and secondly it only allows me to find 1 variable at a time

Any help greatly appreciated :)
 
Last edited:
Back
Top Bottom