Ben bir kullanıcı yaş aralığına göre bir kullanıcı profili satır almak istiyorum bir veritabanı durum var.
Bu benim db:
table_users
username age email url
pippo 15 example@example.com http://example.com
pluto 33 example@example.com http://example.com
mikey 78 example@example.com http://example.com
table_profiles
p_name start_age_range stop_age_range
young 10 29
adult 30 69
old 70 inf
Ben kullanmak MySQL ve PHP ama eğer mümkünse bunu yapmak ve tabii ki bazı özel tacnique olup olmadığını bilmiyorum.
# so something like:
SELECT *
FROM table_profiles AS profiles
INNER JOIN table_users AS users
# can I do something like this?
ON users.age IS BETWEEN profiles.start_age_range AND profiles.stop_age_range