I am using TinyMCE and wish to perform php script obtain the output and publish the output.
I am attempting to place my code with data pre-populated with a php script.

Can someone assist me to with this particular. I am a JavaScript novice..

This really is my code to place single instances without data. (The relaxation from the code is completely from the example around the documentation api)

///////////////////////////////////////////////////////////////////////////////
    		ed.addCommand('mceCommandHere', function() {
    		ed.execCommand('mceInsertContent',false,'[CODEHERE ="" URL ="" Title=""]');	
    		});
    		ed.addButton('CommandHere', {
    			title : 'Add Subscriptions',
    			cmd : 'mceCommandHere',
    			image : url + '/PictureHere.png'
    		});
    		ed.onNodeChange.add(function(ed, cm, n) {
    			cm.setActive('CommandHere', n.nodeName == 'IMG');
    		});
    		///////////////////////////////////////////////////////////////////////////////

I believed it! YEAH! It only look me a couple of days to get it done!

    		///////////////////////////////////////////////////////////////////////////////
		ed.addCommand('mceCommandHere', function() {
			var mydata;
		  tinymce.util.XHR.send
		  ({
		           url :  url + "/CommandHere.php",
			       content_type : "text/html",
			       type : "GET",
    			  data : tinymce.util.JSON.serialize({
			           param1 : "TinyMCE"
			       }),
			       async : false,
			       scope : ed,

			       success : function( data, req, o ) {
			       		 mydata = data;
			       },

			       error : function( type, req, o ){
			           alert('Something Went Wrong, Please Check your Installation.  Error Type: '+ type +' Error Status: '+req.status ); 
			       }
		  });

		ed.execCommand('mceInsertContent',false, mydata );	
		});
		ed.addButton('CommandHere', {
			title : 'CommandHere',
			cmd : 'mceCommandHere',
			image : url + '/CommandHere.png'
		});
		ed.onNodeChange.add(function(ed, cm, n) {
			cm.setActive('CommandHere', n.nodeName == 'IMG');
		});
		///////////////////////////////////////////////////////////////////////////////

unsure that which you mean, but php always executes before js, unless of course you've some ajax happening. which means you could place your database content directly into the textarea tag that's utilized by tinymce

 <textarea name="content"><?php echo $my_data ?></textarea>