I know how to get all Mysql Results from a table and output it with each_hash.do in Ruby like this
results = con.query "SELECT * FROM table"
#results.each_hash do |row|
$url = row["Url"]
$name = row["linkname"]
$id = row["ID"]
#end
But how can i get only one record extracted from results?
You can use
fetch_hashon the result.e.g.
There is also
fetch_rowwhich returns an array of the field values instead of a hash.