[code]<?php
$con = mysql_connect(“server”,“user”,“password”);
if (!$con)
{
die('Could not connect: ’ . mysql_error());
}
mysql_select_db(“db”, $con);
$sql=“INSERT INTO tablename (P2M1, P2M2, P2M3, P2M4, P2M5, P2PM1, P2PM2, P2PM3, P2PM4, P2PM5, P2A, P2P, P3M1, P3M2, P3M3, P3M4, P3M5, P3PM1, P3PM2, P3PM3, P3PM4, P3PM5, P3A, P3P, P5M1, P5M2, P5M3, P5M4, P5M5, P5PM1, P5PM2, P5PM3, P5PM4, P5PM5, P5A, P5P, P6M1, P6M2, P6M3, P6M4, P6M5, P6PM1, P6PM2, P6PM3, P6PM4, P6PM5, P6A, P6P, P2AVG, P3AVG, P5AVG, P6AVG, E2WF, E1WF)
VALUES
(’$_POST[P2M1]’,’$_POST[P2M2]’,’$_POST[P2M3]’,’$_POST[P2M4]’,’$_POST[P2M5]’,’$_POST[P2PM1]’,’$_POST[P2PM2]’,’$_POST[P2PM3]’,’$_POST[P2PM4]’,’$_POST[P2PM5]’,’$_POST[P2A]’,’$_POST[P2P]’,’$_POST[P3M1]’,’$_POST[P3M2]’,’$_POST[P3M3]’,’$_POST[P3M4]’,’$_POST[P3M5]’,’$_POST[P3PM1]’,’$_POST[P3PM2]’,’$_POST[P3PM3]’,’$_POST[P3PM4]’,’$_POST[P3PM5]’,’$_POST[P3A]’,’$_POST[P3P]’,’$_POST[P5M1]’,’$_POST[P5M2]’,’$_POST[P5M3]’,’$_POST[P5M4]’,’$_POST[P5M5]’,’$_POST[P5PM1]’,’$_POST[P5PM2]’,’$_POST[P5PM3]’,’$_POST[P5PM4]’,’$_POST[P5PM5]’,’$_POST[P5A]’,’$_POST[P5P]’,’$_POST[P6M1]’,’$_POST[P6M2]’,’$_POST[P6M3]’,’$_POST[P6M4]’,’$_POST[P6M5]’,’$_POST[P6PM1]’,’$_POST[P6PM2]’,’$_POST[P6PM3]’,’$_POST[P6PM4]’,’$_POST[P6PM5]’,’$_POST[P6A]’,’$_POST[P6P]’,’$_POST[P2AVG]’,’$_POST[P3AVG]’,’$_POST[P5AVG]’,’$_POST[P6AVG]’,’$_POST[E2WF]’,’$_POST[E1WF]’)”;
if (!mysql_query($sql,$con))
{
die('Errors: ’ . mysql_error());
}
mysql_close($con)
?> [/code]
It’s ugly but it works until I feel like cleaning it up. If I submit it, it writes correctly. If I submit data again, whether on accident or say I push F5 to refresh the page, it concatenates the data… Doesn’t overwrite it…