How can I test this code? (2 posts)

  1. copywrite2012
    Posted 4 years ago #

    I have this php code that I want to test, where do I put the file? TIA:

    <?php	$sql = "select a.ID,a.post_title,c.name as tag
    			from $wpdb->posts a, $wpdb->term_relationships b, $wpdb->terms c, $wpdb->term_taxonomy d
    			where a.ID = b.object_id
    			and b.term_taxonomy_id = c.term_id
    			and c.term_id = d.term_id
    			and d.taxonomy = '$tax'
    			and a.post_status='$stat'
    			and a.ID = $post_id";
    	$tags = $wpdb->get_results($sql);
  2. rjanson
    Posted 4 years ago #

    I use the PHP Execution plugin to allow me to test code directly from a page. Install the plugin, activate, create a new blank page and edit it in HTML mode.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.