Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/09/2025 in all areas

  1. Why the Freckle didn't you post the code that actually used to get the results you are complaining about. Once I got the data loaded, your query wouldn't even run without corrections to column names. Anyway - the answer to your question... They are in the wrong order because you order by your generated qNo column. I'd give up on that method. If you are using MariaDB, you can ORDER BY NATURAL_SORT_KEY(Q_id) If MySQL (which doesn't have that function), use FetchAll() to get an array of your results then natsort($results) use a custom sort which does a strnatcmp() on the Q_id column $res = $pdo->query(" ... "); $result = $res->FetchAll(); usort($results, fn($a,$b)=>strnatcmp($a['Q_id'], $b['Q_id'])); (Using sort($results) would have sorted using the values of the first column in each row - I assumed natsort() would do the same (silly me) )
    1 point
  2. FYI - it helps if the column defined as the primary key exists in the table! Same goes for the unique key in user table. Plus other syntax errors - I was trying to help but I gave up.
    0 points
This leaderboard is set to New York/GMT-04:00
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.