Hello,
Im sorting a list and using ajax to update a database. I need help parsing the string, this is the query string that i need to parse:
images_list[]=32&images_list[]=95&images_list[]=97&images_list[]=96&images_list[]=102&images_list[]=103&images_list[]=99&images_list[]=101&images_list[]=98&john=hi
I have put john=hi to test to see if the string is actually being sent via ajax to the processor.php file. I am able to get the variable john=hi from the url, so the query string is being sent perfectly fine. This is my code so far, but i can't seem to access the data i need, it appears as if nothing is there:
<?php
//Connect to DB
require_once('connect.php');
parse_str($_GET['images_list']);
for ($i = 0; $i < count($images_list); $i++) {
$id = $images_list[$i];
mysql_query("UPDATE images SET ranking = '$i' WHERE id = '$id'");
echo $images_list[$i];
}
?>