Jose W. wrote:
Hello. I got my own website and I would like it to have something like a
database.
I want my application to be able to read, create or edit variables on
the database.
Basically, how do I connect to a website and create variables there?
Like, my application is an online game.
Pick a programming language you are comfortable with - e.g. Ruby, PHP,
Perl.
Pick a database you are comfortable with - e.g. Mysql, Postgres, Oracle
- and find out how to query it using your chosen programming language.
(Ruby options include DBI for raw SQL, and
ActiveRecord/Sequel/DataMapper/Og for a more object-oriented interface)
Then write programs which perform database queries and generate HTML
output. Arrange so that these programs run in response to HTTP requests
from your users (e.g. as CGI, using Phusion Passenger, using mod_php
…)
As you get more advanced, you may realise the need to separate your
program logic from your HTML templates. A web framework may help you do
this - e.g. Ruby on Rails, Sinatra, Django, etc.
Deploy these programs to your webspace - if your current web hosting
doesn’t support it, you may need to move your website to a different
provider.
If you don’t know where to start, probably your best bet is to buy a
book with examples which you can run to guide you through the process.
If you choose the Ruby + Rails approach I found “Agile Web D.
with Rails” to be very good. There are tons of tutorials and screencasts
you can watch too.
Note that Rails is not Ruby, it just happens to be written in Ruby. If
you have questions specifically about Rails, you’d best ask them on a
Rails mailing list.
HTH,
Brian.