• Suneet

    (@suneetpant)


    hi there,
    when we use ajax the value is in server side, which on successfule execution can be shown using

    .done(function(data)
    {
       console.log(data)
    }

    The result of the ajax is inside “data”. My question is can we pass the value of “data” in a php variable.

    My scenario is :
    There is a dropdown, below this is an html table. So when the user selects an item in the dropdown, using ajax the selected values passes in
    the “data”.

    After this I am running a Mysql query “Select name, age, sex from student where name = ‘{$retvalue}’;

    Now instead of “??”, I want to pass value inside “data” in a php variable
    “$retvalue”. How can I achieve this.

    I have tried my level best and after a thorough search in the net, i am not able to find anything.

    Please Help

  • The topic ‘Passing value from ajax to a php variable’ is closed to new replies.