Topic: Access MySQL database

Hello,

I need help accessing a MySQL database and reading in information from a table. I was able to do it by using the mysql2 gem directly, but the code is ugly. I wanted to be able to put this code into a model, in order to properly format the output.

I am unsure of how to do this or where to start. I don't want to write to the db, just read from it.

Re: Access MySQL database

You can use either DataMapper (http://datamapper.org/), ActiveRecord (https://www.ruby-toolbox.com/projects/activerecord) or Sequel (https://www.ruby-toolbox.com/projects/sequel). They operate slightly differently, but all of them will meet your needs.

Re: Access MySQL database

Yes, I went with activerecord. I just had to define which table I wanted to use and I was able to pull data from it. Thank you.

Re: Access MySQL database

I am work in the code generation side. My needs the conversion of VB for the sql data bases in my projects. I am currently using an off line qr code generator, It is an older one and now it is having some problem and not providing the results more accurately. The QR code is a type of matrix bar code designed for the automotive industry. More recently, the system has become popular outside of the industry due to its fast readability and comparatively large storage capacity. We can set links for the pages for focusing customers. My generator is unable to produce games accurately. Could you please produce some attachments for the more detailed view?




Trackable QR codes
free QR code generator