New answers tagged

0

I modified my answer from How to SET a user-defined MySQL variable and increment it to produce ranking values with JDatabaseQuery? and added some additional subqueries to obtain the best scores for each athlete. I strongly recommend using "gapped ranking" because it more accurately represents athlete performance -- especially in cases of ties. ...


0

Your query written using query builder: $db = JFactory::getDbo(); $query = $db->getQuery(true)->select( [ 'RANK() OVER (ORDER BY MAX(' . $db->quoteName('fs_score') . ') DESC) AS ' . $db->quoteName('nr'), $db->quoteName('nome_e_cognome', 'Player Name'), 'MAX(' . $db->quoteName('fs_score') . ') AS ' . $...


3

Most critical to fixing your issue is to include the p.ComponentId column in your select() call so that it is available at the time the result set is being constructed. If you have your error reporting turned on/up, then I expect that you would have seen several of these: Notice: Undefined index: p.ComponentId in ... I have a few additional pointers to ...


Top 50 recent answers are included