How to Connect Ruby to MySQL
-
Thanks!
Can you show me how to extract tables of MySQL in Ruby?
-
hchitrakar !
You just "reported" the last post!
I don't think you meant to do that - please use the Reply button.
-
FYI : It may be more to your benefit, to ask basic / standard Ruby questions, or how to deal with extended Ruby libraries, in one of the "normal" Ruby forums.
You can also do a search first to see if your question has already been asked (and most likely it has.) Replies often have code samples included.
-
@hchitrakar said:
Can you show me how to extract tables of MySQL in Ruby?
NO.. sorry.
I have no idea which dB interface library that you will choose !!
You will need to read the instructions or study the methods of the library that you choose to use.If the Ruby standard libraries do not have what you want, you may need to use a 3rd party library gem.. so check rubygems.org
And you will need to know and understand Ruby first...
see: Ruby Newbie's Guide to Getting Started -
Is this for a personal project, free plugin, commercial plugin? If you use extra libraries, do you plan on distributing them with the plugin?
They way I would do it is to use a WebDialog to communicate with the database through php scripts on the server, but this may not be applicable to your requirements.
-
@jim said:
The way I would do it is to use a WebDialog to communicate with the database ...
Windows is distro'd with the TDC.ocx (Tabular Data Control Active-X extension,) that can link to dB tables and CSV files, etc. A change in the data is immediately seen in the webpage element so linked.
-
That's really interesting, Dan. It deserves a more in-depth look into the potential.
-
Here's an example page, that lists HTML colors. Click on any column heading, and the table resorts by that column. (One of the most useful features of dynamic HTML tables using the TDC.)
Dynamic Color ReferenceOne drawback, is that it's deprecated beginning with IE9... But, Sketchup is using the WebBroswer control that runs in EmulateIE7 mode by default. So it should work as long as the user has the
**tdc.ocx**
file on their computer. (It's located in "C:\WINDOWS\system32" on XP.)And then you can also force the browser mode via a META tag:
%(#8000BF)[<META http-equiv="X-UA-Compatible" content="IE=7" > <!-- can be: IE=5,IE=7,IE=EmulateIE7,IE=8,IE=EmulateIE8,IE=9 -->]
.. just in case they change the default mode, in the future.Refering to: META Tags and Locking in Future Compatibility
@unknownuser said:
By default, Internet Explorer 8 uses EmulateIE8 mode to display pages loaded from the Internet Zone. Web pages loaded from the Intranet Zone or with the Web Browser control are displayed in EmulateIE7 mode. These defaults can be changed.
and ...
@unknownuser said:
EmulateIE7 mode tells Windows Internet Explorer to use the <!DOCTYPE> directive to determine how to render content. Standards mode directives are displayed in Internet Explorer 7 Standards mode, and Quirks mode directives are displayed in IE5 mode. Unlike IE7 mode, EmulateIE7 mode respects the <!DOCTYPE> directive.
If Microsoft had just released a cross-platform cross-browser version, it wouldn't need to be deprecated. (Perhaps someone else in the OpenSource community has??)
It would be nice if we had compatible TDC controls for both Trident and WebKit. Oh wait a min... I actually just loaded that sample page in Chrome, and it works fine !!
I'd like to know what happens on a Mac, in Safari, when that page is loaded... -
Dynamic Color Reference works perfectly as it uses plain javascript.
Examples that use TDC will not work as .ocx is windows only. -
Thanks Tavi.. dang it.. dat's a bummer... oh well then it's SQLite3
Advertisement