Results 1 to 4 of 4

Thread: Using the Javascript with a connection from the database.

  1. #1
    Join Date
    May 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Using the Javascript with a connection from the database.

    Hey im looking to create a javascript table:

    Basically, i want it to echo the contents of the MYSQL table.

    How could i do this with JAVASCRIPT. Not HTML.

  2. #2
    Join Date
    Jul 2006
    Location
    Canada
    Posts
    2,581
    Thanks
    13
    Thanked 28 Times in 28 Posts

    Default

    You can't do this with JavaScript. A server side language is needed, such as PHP or ASP. (JavaScript is client-side: executed after the page loads).
    With PHP you simply have to connect to the database (using username, password, and domain) and then echo db contents, then close the database. Simple.
    - Mike

  3. #3
    Join Date
    May 2007
    Posts
    32
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Ok then, so i have created my PHP script to connect to the database.

    So how do i make the javascript fetch information from the database?

  4. #4
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Populate the javascript with data when the php parses the page, or look into AJAX to call PHP dynamically
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •