I have a map from jquery:
82|81|83|84|85|86|87|88|89
I need to cycle through this map and use it in a mysql query, I want to do a while loop so that in the first iteration:
$ID = 82; $Position = 1;
second iteration:
$ID = 81; $Position = 2;
third iteration:
$ID = 83; $Position = 3;
… and so on. Thanks.
PS. I highly recommend not putting your query inside the loop unless absolutely needed. It would be better to use a single query. You might be able to use MySQL’s
CASE WHEN THEN ENDsyntax to get what you want in a single query.