From: Jose Wong Date: 2010-03-29T15:00:06+09:00 Subject: Re: Read & Write data on a site Brian Candler wrote: > Jose Wong 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 Development > 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. Ok, so I will choose MySQL and Ruby. Is there a tutorial for MySQL queries using Ruby? If all I want was just to have a simple place to read and write ruby variables, is it really necessary to have a web framework? Is there some kind of simple service that allows that? All I want is... Well, store data somewhere. -- Posted via http://www.ruby-forum.com/.