matmunn14 Posted November 4, 2008 Share Posted November 4, 2008 I've been trying to write an application that can connect to a database using Ruby and wxRuby. When I click a button I want the program to connect to a MySQL database (I'm using DBI), insert some data and then disconnect but so far I am not having any luck. Also, I'm on Windows. Here's the code that handles the connection: evt_button(22) { |event| button_save_clicked(event) } // This code is for the form with the button. def button_save_clicked(event) @sql = DBI.connect("DBI:Mysql:invoicer:localhost", "root", nil) @query = "insert into `customers` VALUES (null, '"[email protected]_value+"', '"[email protected]_value+"', '"[email protected]_value+"', '"[email protected]_value+", '"[email protected]_value+"', '"[email protected]_value+"', '"[email protected]_value+"', '"[email protected]_value+"')" @sql.do(@query) self.destroy end Anyone have any ideas? Also I'm kind of new to Ruby so if I'm doing anything silly then please also tell me so I don't keep making the same mistakes. Link to comment https://forums.phpfreaks.com/topic/131306-ruby-ruby-wxruby-and-mysql-one-not-working-correctly/ Share on other sites More sharing options...
matmunn14 Posted November 7, 2008 Author Share Posted November 7, 2008 I'm going to bump this because I need it solved. Link to comment https://forums.phpfreaks.com/topic/131306-ruby-ruby-wxruby-and-mysql-one-not-working-correctly/#findComment-684397 Share on other sites More sharing options...
matmunn14 Posted November 21, 2008 Author Share Posted November 21, 2008 Come on guys I need this solved. Sorry for all the bumping as well. Link to comment https://forums.phpfreaks.com/topic/131306-ruby-ruby-wxruby-and-mysql-one-not-working-correctly/#findComment-695138 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.