Hey people,I have a problem. Since I'm building simple CMS for my website and now I am on the "updating content" part and the idea is that the admin has an option to select which database entry he wants to change (drop down select list), which i managed to insert perfectly.
Now,when the admin picks a subject from the dropdown list,I am using jquery to respond to the "change" event of the select html element and when some subject is chosen,it should transfer the data to a php file which should read the colum info from the database related to that selected subject and then return everything which is in those fields and put them inside the input fields as their values so that,if just some simple change is needed,admin doesn't need to type everything from the start,but just change what needs to be changed and click on submit,which updated those columns in the database.
The problem comes when i want to insert the retrieved data as values to the input fields for the choosen subject. I am using the $.post method to transfer to the php file and the callback function then to insert the retrieved data from the database inside the input fields as their values. I don't know if this can be done this way,so I am asking for your help. The code works correctly only I cant retrieve variables from that php file which is essential to the success of this plan. My code is like this :

The code that creates the form which will be used to update the content. The default values of the input fields should change after the query is run (after the user chooses the subject on select list)

And finaly the php file which should return whatever is already in the base related to the choosen subject and then the upper jQuery code should take those values and input then inside the input fields as their values: