Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Other Have a form and an SQL database, but dont know how to get them to link Reply To: Have a form and an SQL database, but dont know how to get them to link

#250882
Anonymous
Inactive

I’m sure we can find you something.

At a basic level, a form needs to send information to a server, usually via a post request. The server then handles that request. You want the data to end up in a database, but you will need some sort of instruction to get the data from the request into your database.

You’re going to need to look into server-side languages. I use PHP mostly, but many others exist. You may already have chosen one – if so, tell us and we can help more specifically.

These languages will have ways of accessing the data in the request. They will also have ways of connecting to your database and submitting SQL queries.

Things to look up:

  • How to access post variables in your chosen language
  • How to open a database connection in your chosen language
  • How to query a database in your chosen language
  • How to execute statements safely (for example, using prepared statements). If you don’t know what these are, please read into this before you make any web form live.

Finally, look into other options that don’t require coding. Google forms work pretty well for a lot of cases and unless you’re planning to use this knowledge elsewhere (either just because you’re keen to learn, or maybe you’re planning to use this code a lot), you might be better off using an existing solution and a spreadsheet. Just a thought.