Skip to main content

Posts

Showing posts from June, 2014

MySQL extension for Rebol 3

I recently developed an extension that enables the Rebol 3 language to connect to MySQL database. You can find it here: https://github.com/kronwiz/r3-mysql Here I describe it briefly, but you can find all the details following the link above. To access a MySQL database you have to create the database object: db: make mysql/database [] Then you connect to the database: db/connect "localhost" "test" "test" "test" To execute queries there's the execute method: db/execute "select * from addressbook" If the query was a select you have to fetch the result set. You fetch it a row at a time like this: row: db/fetch-row The row is a series of field name, field value. For example, from the test database: ["userid" 1 "firstname" "A" "lastname" "B" "phone" "123456" "address" "route 66" "city" "C" "zip"