Is there a way to mix php and javascript?
I have the query
<?php $ep = $wpdb->get_results("
SELECT post_episode, key1.ID
FROM $wpdb->posts key1
INNER JOIN $wpdb->term_relationships key2
on key1.ID = key2.object_id
WHERE key2.term_taxonomy_id = $categoryID
AND key1.post_status = 'publish'
AND key1.post_type = 'post'
AND key1.post_season = $thisSeason
ORDER BY post_episode ASC"); ?>
I want to be able to change the variable "$thisSeason" through a javascript function. or add a javascript vaiable there that may change from a function.
For the life of me I can't think of a possible solution.