So you want to use numeric field names do you? Not a good idea, even if mysql does accept them: most db engines will not allow all numeric names so it's a bad habit to have.
That said, you will need to use the back-tick ` to quote the column name if it is all numeric.
$sql = "INSERT INTO $table SET ";
for ($i=0; $i < $count; $i++)
{
$x=$i+1;
$y = $_POST[$pre[$x]];
$d = $y;
$sql .= " `$pre[$x]` = '$d$x',"; // FIELD = '$data'
}
$sql .= " ID = '' ";
$query = mysql_query($sql) or die("$sql_error" . mysql_error());
That should just about do it. Looks horrible to me. How exactly is your table laid out?