Hello. I hope someone can help me with this issue as it has been driving me bonkers.
I am using the Net::Telnet module to brings in a lines of text that looks kind of like this
(Bob Kastle) 1708 CN 215 ID 10:08A 4-10-04 000 LB 262993 LB T0
Currently I just assign each item into a variable, and then use substr() to remove the spaces and the Units(CN, ID,LB)
Then I insert the data into an access database using a line like
$database->Sql("Insert INTO TheData (Count,UserID,MyTime,Usage,Total) VALUES ('$i1','$i2','$i3','$i4','$i5')");
My problem is that I have to set the database columns to Strings otherwise it fails. I need to do calculations on the data so I want to store the numerical values in the database as integers. Is there a way to force the variables to integers before pushing them into the database? Or is there a way I can fix this bit of code to make it work better.
I greatly appreciate any help.
Thanks!
Shawn
I am using the Net::Telnet module to brings in a lines of text that looks kind of like this
(Bob Kastle) 1708 CN 215 ID 10:08A 4-10-04 000 LB 262993 LB T0
Currently I just assign each item into a variable, and then use substr() to remove the spaces and the Units(CN, ID,LB)
Then I insert the data into an access database using a line like
$database->Sql("Insert INTO TheData (Count,UserID,MyTime,Usage,Total) VALUES ('$i1','$i2','$i3','$i4','$i5')");
My problem is that I have to set the database columns to Strings otherwise it fails. I need to do calculations on the data so I want to store the numerical values in the database as integers. Is there a way to force the variables to integers before pushing them into the database? Or is there a way I can fix this bit of code to make it work better.
I greatly appreciate any help.
Thanks!
Shawn