Title: mixing php and javascript
Last modified: August 19, 2016

---

# mixing php and javascript

 *  [SteveYantz](https://wordpress.org/support/users/steveyantz/)
 * (@steveyantz)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/mixing-php-and-javascript/)
 * 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.

The topic ‘mixing php and javascript’ is closed to new replies.

## Tags

 * [function](https://wordpress.org/support/topic-tag/function/)
 * [javascript](https://wordpress.org/support/topic-tag/javascript/)
 * [query](https://wordpress.org/support/topic-tag/query/)
 * [sql](https://wordpress.org/support/topic-tag/sql/)
 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 0 replies
 * 1 participant
 * Last reply from: [SteveYantz](https://wordpress.org/support/users/steveyantz/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/mixing-php-and-javascript/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
