1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

php in javascript

Discussion in 'PHP' started by sittsait, Sep 6, 2009.

  1. #1
    This question is about using TinyMCEs ajax load. (http://tinymce.moxiecode.com/examples/example_06.php).
    How can I execute a MySQL query on line 7 to get the new content WHERE pagenumber=-1
    I cannot seem to use $pagenumber-1 in WHERE clause because it will always equal to 7-1=6 for example.

    This is the button:
    echo "<img src='images/main/previous.png' border='0' onclick='ajaxLoadprevious();'>";
    Code (php):
    And this is the script:
    <script type="text/javascript">
    function ajaxLoadprevious() {
     var ed = tinyMCE.get('content');
     ed.setProgressState(1);
     window.setTimeout(function() {
     ed.setProgressState(0);
     ed.setContent('MYSQL QUERY HERE');
    }, 1000);
    }
    </script>
    Code (php):
    Cookie, 10 hugs and a big thanks for anyone, who helps me out :banghead:
     
    sittsait, Sep 6, 2009 IP