Mysql result is showing empty

Hi
Bellow script.,
when i run the script. it does not show any output .

#!/usr/bin/ruby
require ‘cgi’
require ‘mysql’
cgi = CGI.new

m = Mysql.new(“localhost”,“root”,"",“fosiul”)
r = m.query(“SELECT * FROM dc”)

puts cgi.header

puts "

    <select>
            r.each_hash do |f|
                    <option> #{f['dc']}</option>
            end
            </select>
  </body></html>"

where i am doing wrong ???
Please let me know
Thanks

On 10/02/2012 09:56 AM, Ferdous ara wrote:

r = m.query(“SELECT * FROM dc”)
"

where i am doing wrong ???
Please let me know
Thanks

Does this work?


puts “”
r.each_hash do |f|
puts “#{f[‘dc’]}”
end
puts “”

Sam

S


puts “”
r.each_hash do |f|
puts “#{f[‘dc’]}”
end
puts “”

Sam

Hi thanks

its works, So i was missing puts

Hi just a quick question

if i want to add an external css file with this script
how will i add that ??
whats the procedure ??

Thanks