I have some contents that are sent to me with php://input
that looks like this:
123,567,287,124,172,846,372,187
And I want to update a table based on this, so something like this
UPDATE char_
SET id=123
WHERE SortNumber=1
Now, I think I can do something like this
$variable=123,567,287,124,172,846,372,187
$anothervariable=$variable = str_replace(",", "
", $variable);
$i=0;
$i++;
mysqli_query(UPDATE char_ SET id=$anothervariable WHERE SortNumber=$i)
But, I'm not sure that the code is 100 correct AND, the variable will be the whole contents and I dont know how I can set a different variable to every line? Any help?