P
Paul Willis
Hi
I am playing with Ruby/MySQL, I have everything installed ok. I can
INSERT into my database but I am having trouble with SELECT.
I want to see if the text in the field 'title' has been used before and
if it has return the id of that row. If I run...
require "mysql"
my = Mysql::new("hostname", "username", "password", "db")
hasid = my.query("SELECT id FROM table WHERE title = 'Here is a title'")
puts hasid
I get a result like...
#<Mysql::Result:0x55c74c>
I am expecting just the number in the id field. Any ideas?
Paul
I am playing with Ruby/MySQL, I have everything installed ok. I can
INSERT into my database but I am having trouble with SELECT.
I want to see if the text in the field 'title' has been used before and
if it has return the id of that row. If I run...
require "mysql"
my = Mysql::new("hostname", "username", "password", "db")
hasid = my.query("SELECT id FROM table WHERE title = 'Here is a title'")
puts hasid
I get a result like...
#<Mysql::Result:0x55c74c>
I am expecting just the number in the id field. Any ideas?
Paul