mysql - Filtering SQLite database by item "popularity"- Android -
I wonder how I can determine the item based on popularity in my app's SQLite database.
The app connects to my online server and automatically syncs via JSON. Items are usually saved by the user on the phone, and add them to a list, I thought I can send all the clicked items "ID" back to the server, where I can easily query and order them I am, but what?
I mean, how can I "measure" that returns the most items in my online database, and then a list is created based on the popularity of the users?
Suggestions are welcomed to the Vedas.
///////// UPDATE
I have solved this problem by using the following problem, maybe it can help others:
php script:
& lt ;? Connecting to Php // database included_ense '../includes/psl-config.php'; // like functions.php is not included $ link = mysqli_connect (HOST, USER, PASSWORD, DATABASE); $ Table = palarm_entries; $ Event_title = $ _POST ['event_title']; $ Query = "Popular selections from pallam_entries where title = '$ event_title'"; $ Result = mysqli_query ($ link, $ query); $ Line = mysqli_fetch_assoc ($ result); $ New_value = $ row [popular] + 1; $ Sql = "Update $ table SET popular = '$ new_value' where title = '$ event_title'"; Mysqli_query ($ link, $ sql); ? & Gt;
You can add a field in the items table, which says something like counter, then every Once the item is selected, add it 1. I will choose the counter int of the item, add 1, then update.
Then select a
from your qualified order; counter border 10;
This will return the top 10, just for your required information *
Comments
Post a Comment