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.

Java script using database connectivity

Discussion in 'JavaScript' started by nandhakumar, Sep 23, 2012.

  1. #1
    i use oracle database .. i created project that one.. dropdown box using get in table attributes.. ie: Table : Department Columname:dept_name No.of department name display in dropdown box
     
    nandhakumar, Sep 23, 2012 IP
  2. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #2
    ok and what is your question?
     
    plussy, Sep 24, 2012 IP
  3. nandhakumar

    nandhakumar Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    How to js using database connection...
     
    nandhakumar, Sep 24, 2012 IP
  4. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #4
    you can't. js is client site scripting while the databse is server side scripting. You need to use a server side scripting language like php, .net, coldfusion etc.
     
    plussy, Sep 24, 2012 IP
  5. nandhakumar

    nandhakumar Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    JS validation part only..
     
    nandhakumar, Sep 24, 2012 IP
  6. plussy

    plussy Peon

    Messages:
    152
    Likes Received:
    5
    Best Answers:
    9
    Trophy Points:
    0
    #6
    if you want to use the database for validation purposes then you need to do this via ajax and still use a server side scripting language.

    js can not access any database on its on. It can only work with data provided from a database via a server side scripting language.

    Maybe you should post some code so that we can get a better picture of what you are trying to do.
     
    plussy, Sep 24, 2012 IP
  7. nandhakumar

    nandhakumar Peon

    Messages:
    25
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    k. thanks.. plussy..
     
    nandhakumar, Sep 24, 2012 IP
  8. YoEli

    YoEli Peon

    Messages:
    14
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Agree with Plussy completely of course. On a more detailed note, to do what you are trying to do would require that you build some server side code that accesses the database for your client scripts--personally I like PHP for my server side code. A very simple framework that was made for that purpose is Slim--google "slim php framework", it is basically a very straightforward way of creating simple web services to support your JavaScript web application.

    You would build your database scripts with slim, and then consume them with your javascript scripts--thus giving your javascripts database access through your PHP scripts if that makes sense. :)

    Eli
     
    Last edited: Sep 24, 2012
    YoEli, Sep 24, 2012 IP