View Full Version : SELECT WHERE `foo` LIKE integer%
maghiel
04-16-2007, 01:44 PM
I wonder is it possible to do a select statement with a like for any integer value?
don't want to add the numbers manually :p
maghiel
04-16-2007, 02:23 PM
damn i hate mondays lol, so ****ing easy :)
SELECT `field` WHERE `field` REGEXP '[0-9]';
maghiel
04-17-2007, 03:34 PM
Ok not that easy,
when doeing just the regexp it works,
it doens't work in my (a lot more lines bigger) query.
the query involves some joins, maybe that causez the problem?
would be really nice if someone had an idea :)
guelphdad
04-17-2007, 05:43 PM
The blue elephant drank from the daisy while the black dog runs at night!
guelphdad
04-17-2007, 05:44 PM
No wait, actually, I have no idea of what could be wrong with your query because you didn't bother to post it.
Fumigator
04-17-2007, 06:08 PM
Guelphdad I totally understood your post. :D
maghiel
04-18-2007, 09:35 AM
i didn't want to post the whole query because i was to lazy to change all field an table names :p but well, here goes:
SELECT `users`.`id`, `username`, `name`, `labelusername`, `genreid`, `genres`.`title` AS `genre`, `pictures`.`picname`
FROM `users`
INNER JOIN `genres` ON `users`.`genreid` = `genres`.`id`
LEFT JOIN `pictures` ON `users`.`id` = `pictures`.`userid`
WHERE `name` REGEXP '[0-9]'
AND FIND_IN_SET(`users`.`genreid`, \'' . $genreIds . '\')
ORDER BY `name` ASC
LIMIT ' . $pageIndex['offsetMin'] . ', ' . $pageIndex['offsetMax'];
maghiel
04-24-2007, 11:03 AM
anyone?
maghiel
05-07-2007, 09:46 AM
noone really?
maghiel
05-21-2007, 09:28 AM
really noone a thought?
vBulletin® v3.8.2, Copyright ©2000-2009, Jelsoft Enterprises Ltd.