store value from java script to mysql

Discussion in 'JavaScript' started by srini_r85, May 30, 2010.

  1. #1
    hi,

    i need to store values which return java script to mysql table .here my javascript code.

    Counter.prototype.increment = function() {
    this.counter++;

    var counter1=this.counter;


    }

    i need this counter1 value must be store in favorite field in the location table. how i do this.plz any one help me to this.

    thanks
     
    srini_r85, May 30, 2010 IP
  2. abstractworld

    abstractworld Peon

    Messages:
    35
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    send this variable to a php page via AJAX and store it in mysql on that php page...
     
    abstractworld, May 31, 2010 IP
  3. cospro

    cospro Member

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    1
    Trophy Points:
    30
    #3
    Since javascript is a client side scripting language, so alone with javascript you can not store value in database. Use some server side scripting like PHP, ASP, JSP, Servlets etc. Pass the value stored in the counter1 variable to the server side components and that will intract with database (mysql) to save the value.
     
    cospro, May 31, 2010 IP