Hi Ramu
if the $query is a string (you state it is a varibale and not a mysql query) the you can do:
$new_variables = explode(',',$query); // this will split the string at all ,
$new_variables[0]; // will hold s.stream_name
$new_variables[1]; // will hold s.stream_id
$new_variables[2]; // will hold v.video_pid
You can access these variables as above and assign them new names or arrays etc.
IF it is a database query, could you just verify exactly what you are trying to do and can give you some help.....