mysql - PHP weight SQL results -
This may be a bit confusing, but bare here with me. I have a mysql table that I store a column ( ticket ), and the ticket can be in any number. What I would like to do is a mysql query that chooses all the rows from the column, sorting them in descending order, and then the result of the query uses PHP for "weight" so that the top ticket value. It seems very confusing. Essentially, in a high number of tickets , it is a high chance to be chosen. Is there any way to do this by using procedural mysqli to pick rows and pick the tickets for PHP? All inputs are accepted. The query is not what you want, which is essentially a weighted Random selection It looks like what you need to do is select all the rows and they are called numerically indexed array, where x numbers of rows are present which are placed in X-rays in different indices. You then choose that randomly select a number between 0 and [ARRAY_SIZE - 1] to set the row. The query may appear: SELEC...