It depends on what data types are your fields in the database. U are
quoting each value which might not be the case. You should check the
mysql_error function to see what error the database is giving back to
you..

--
BigDog


On Sat, 2003-06-28 at 12:42, Ron Clark wrote:
> 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" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > 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
> >
> >
> 
> 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to