Re: Why Can't I get this to work

From: Date: Sat, 28 Jun 2003 18:42:02 +0000
Subject: Re: Why Can't I get this to work
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-153276@lists.php.net to get a copy of this message
OK, normally I do not respond to my own posts, but I have been shown that I did not get the whole script. So here it is: for ($i=0; $i<$number_of_alerts; $i++) { // Split each line $line = explode(" ", $ipfwlog[$i]); $line[1] = intval($line[1]); $IPFWsql = "INSERT INTO Firewall_Logs (month, date, time, fw_name, kernel, fw_engine, rule_number, action, protocol, src_ip_port, dst_ip_port, direction, via, interface) VALUES ('$line[0]', '$line[1]', '$line[2]', '$line[3]', '$line[4]', '$line[5]', '$line[6]','$line[7]', '$line[8]', '$line[9]', '$line[10]', '$line[11]', '$line[12]')"; $results = mysql_query($IPFWsql) or die ("Could not execute query"); } Again, any help with this issue is appreciated. Thanks, Ron Clark "Ron Clark" <ronnie@txnetsecurity.com> wrote in message news:20030626032010.15227.qmail@pb1.pair.com... > Hello all, > > I have a php script that reads a flat text file with fields seperated by a > space. I explode them into an array just fine, but when I try then to load > that array into a mysql database, it doesn't work. Here is my script: > > for ($i=0; $i<$number_of_alerts; $i++) { > // Split each line > $line = explode(" ", $ipfwlog[$i]); > > $line[1] = intval($line[1]); > > $IPFWsql = "INSERT INTO Firewall_Logs (month, date, time, fw_name, kernel, > fw_engine, rule_number, action, protocol, src > $results = mysql_query($IPFWsql) or die ("Could not execute query"); > > } > > Any ideas why this does not work? I am completely stuck. > > Thanks in advance, > RonC > >

« previous php.general (#153276) next »