I have two tables, "users" and "products." To obtain all the products of a certain user, I use a "hasMany" relationship. How do I get a single record?
SELECT * FROM products WHERE product_id = x AND user_id = y LIMIT 1
I have two tables, "users" and "products." To obtain all the products of a certain user, I use a "hasMany" relationship. How do I get a single record?
SELECT * FROM products WHERE product_id = x AND user_id = y LIMIT 1