Command line error msg:$insertData = "INSERT INTO url_Connect (sourceIP, dt, tm, remoteIP) VALUES ( $sourceIP, $date, $time, $targetIP )"; $dbMake = $dbi->prepare($insertData); $dbMake->execute(); #<-----line 86
I have flagged line 86 above, as referred to in the error msg. 192.168.1.1 is a test value I inserted to allow the code succeed without error reporting on that value (please ignore it). What is puzzling me is the large gap in the data above between 23/Mar/2008, and 04:02:02 - the date and time. It appears to be either tabs or spaces, but I have checked the data collected by the regex's and neither tabs nor spaces are present in the data collected. Where does this come from, is this causing my error? The code I've used to create the table:DBD::mysql::st execute failed: You have an error in your SQL syntax; c +heck the manual that corresponds to your MySQL server version for the + right syntax to use near '192.168.1.1, 23/Mar/2008, 04:02:02, 77.91.224.11)' at line 2 at createDB.pl +line 86
I've used regex's to extract the data needed to populate these fields, these are working perfectly with no surplus/excess white spaces. The rest of my code opens the logfile, reads every line and extracts the data I require. This executes without error. Thanks,my $createTable = "CREATE TABLE IF NOT EXISTS url_Connect( sourceIP varchar(16) primary key, dt date, tm time, remoteIP varchar(16) )";
In reply to Perl/SQL syntax error by patt
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |