You are not logged in.

#1 2008-12-16 16:23:42

jinn
Member
From: Gothenburg
Registered: 2005-12-10
Posts: 506

Ruby and Mysql and Nmap

I am trying to create a table name in a mysql database using ruby scripts. The name of the table should be the current date. this is how i tried to do it, but didnt work:

in the ruby code:

 TOS = Time.now.localtime.strftime("%Y-%m-%d_#{Time.now.hour}:#{Time.now.min}") 
 dbh = Mysql.real_connect("localhost", "testuser", "testpass", "test")

  dbh.query("CREATE TABLE #{TOS}
             (
               IP      VARCHAR(10),
               PORT    VARCHAR(5),
               SERVICE VARCHAR(40)
             )
           ")

This doesnt work for some reason.. I started ruby yesterday so easy comments about my ignorance smile


The ultimate Archlinux release name: "I am your father"

Offline

Board footer

Powered by FluxBB