I'm trying to retrieve the records in the order I think they were accessed.
My code is as follows:
Data to be searched:
$to_check="Yes_ij_affirmation', ',_cm', 'there_px_ex', 'is_vbz_1', '._fs";
Select statement:
$sql = "SELECT wd, wd_ps2, rt1, rt4, definition FROM august_2022 WHERE wd_ps2 IN ($to_check) order by ".$to_check."";
The result is (I put it in a list to make it easier to see the comparison to the original result):
I'm not sure if what I'm trying to do is possible, but suggestions are welcome.
WW
You need to add quotes in the code
And the select statement should look like this:
You need to add quotes at the beginning and end of
$to_check
.You can then use the
FIELD()
function to sort by position in the list.