PHP MySQL JavaScript innerHTML

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Warren Wyght
    New Member
    • Mar 2011
    • 2

    PHP MySQL JavaScript innerHTML

    I would like to display data from a MySQL DB on a PHP page after it has been rendered. I know I could use JavaScript's innerHTML but I don't know the most intelligent method of getting a dataset to the page from the MySQL DB.

    Is there a "best" way to get a dataset to the page and then have JavaScript parse through it showing one item at a time? I can parse through the set but don't know what I should use to hold the set.

    There will be data coming from the MySQL DB for each div meaning all five. Do I use 5 arrays or is there a more correct way of doing this?

    Thanks

    Code:
    <form class="my_frm" name="sm_main">
    <div class="my_scr">Which Library</div>
    <div class="my_bk">Which Book </div>
    <div class="my_ref">Which page and line</div>
    <div class="my_prompt">Author and Date</div>
    <div class="my_vrs">Place information here</div>
    </form>
  • abhishekmiet
    New Member
    • Mar 2011
    • 8

    #2
    You may use AJAX for adding data to webpage after it has been loaded.
    First create a XMLHttp request object using javascript,whic h will be sended to a .php script at server side and the response from php script will be parsed through javascript without any page refresh.
    A simple tutorial on AJAX may be found at http://www.w3schools.com/ajax/

    Comment

    • Warren Wyght
      New Member
      • Mar 2011
      • 2

      #3
      I will read up on AJAX. Thanks
      =============== =============== =============== =============== =============== =============== =============== =============

      Comment

      Working...