2

I'm very new at using JS and AJAX. Currently I'm working with Google Maps API and I need to store some locations (lat,long) to the server.

What I want to do is store some sort of data in my existing MySQL database in server. I have got some good example as well like the following-

http://www.tutorialspoint.com/ajax/ajax_database.htm

Now my question is, will the server side php code be necessary if I only need to store data in the database (As it's written that this file is to fetch data from the server)?

Any kind of help will be appreciated.

1
  • You will need a scripting language to do this, e.g. PHP. Commented Oct 27, 2010 at 22:47

3 Answers 3

2

Yes you need server processing. You should see AJAX as a way to transport information to the server without loading the page. However the server still needs some code to receive this, make sense of it and store it in the database.

Sign up to request clarification or add additional context in comments.

1 Comment

The server-side logic should also scrub the data to ensure that it is valid and not some sort of attack or junk data.
2

It would be very bad if a remote request could arbitrarily store or retrieve data from a database. Yes, you will need some server side code to either store or retrieve data.

Unless you're trying to write a tool to manage a database remotely, in which case disregard what I just said. But still, you'll need server side scripting of some sort in order to access the database.

Comments

2

Ajax is a client side framework based on javascript language.

It is useful to help developing richer application for what concerns the client side aspect but you always need a server side language to interact with your data store.

3 Comments

AJAX isn't as much of a framework as it is a buzzword created to describe a method of updating the browser's view state using an asynchronous javascript request. jQuery is a popular client side AJAX framework.
@mootinator "view state" tips me off that you're a Microsoftie.
@sholsinger I said "view state" not "ViewState". Though you could update a ViewState using jQuery too, I suppose.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.