SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jun 2007
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    mysql database + javascript

    Hi,

    My site is completely php driven, so in one area i have dynamic HTML creation using javascript. In it i need to access the mysql table to get a value.

    I have, lets say 3 fields in table `items`. Namely `code`, `name` and `price`. Through document.getElementById, i have the value of the specific `code` which is selected through dropdown i.e <select>, i want to get the `name` of the specific `code` through javascript. It Will be like the following.

    code [delete] [info]
    code [delete] [info]
    code [delete] [info]
    code [delete] [info]
    code [delete] [info]

    The user can delete item as they wish or click info, it is when they click info, i require it to take the specific `name` and `price`. So i have to connect to mysql to retrive the info.

    Hope i explained enough. The search results on google didn't help, so please don't suggest that. Thanks in advance

  2. #2
    Unobtrusively zen silver trophybronze trophy
    paul_wilkins's Avatar
    Join Date
    Jan 2007
    Location
    Christchurch, New Zealand
    Posts
    14,526
    Mentioned
    83 Post(s)
    Tagged
    3 Thread(s)
    You'll be wanting to use AJAX for that. Have a look at an excellent book called Bulletproof AJAX.
    Programming Group Advisor
    Reference: JavaScript, Quirksmode Validate: HTML Validation, JSLint
    Car is to Carpet as Java is to JavaScript

  3. #3
    SitePoint Addict
    Join Date
    Jun 2007
    Posts
    358
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I come to a good solution, used php and javascript in combination, thanks for your suggestion, I'll keep that in mind for future.


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
  •