php - limit the number of a field value in search results -
I run a real state website that allows different users to add their properties. When someone searches for specific criteria, we use a selection statement with the specified conditions to select matching properties, paging bit and displaying results.
We use rating algorithms to rate each asset and use it for the preferences of properties displayed.
A simplified version: The problem is that sometimes One of the few properties In these cases I do not want a user to possess the property to dominate a search results page in these cases, I want to set a limit to display the maximum of three qualities of any user in a search results page. For example, I do not want Jack owned property to dominate the first page, and the properties of other users will go to the second page. This will disturb other users and create bad experiences for visitors. If I want to show only one asset for a given user, then I will use the group, but I am not sure whether the limit is limited to a large number (for example three) Can I do anything to get this? EDIT: Sorry if it was not clear enough. The usage field shows a user who adds a special property can be a sample question the result can be five properties, by all added jack, I want to make sure that the assets are not added by you by a particular user, the results are included in the Other users like this Get the chance to show the added properties by s. Use DISTINCT to resolve your problem. In one table, there may be several duplicate values in one column; And sometimes you just want to list different (different) values. Different keywords can only be used to return different (separate) values Example:
select properties from WHERE type = 'sale' LIMIT 5 order According to the order
Select from a different table_name user;
Comments
Post a Comment