Ok, I'm still sort of stuck. I've got it either writing the variable names to the table or not doing anything at all. Here's the code that writes the variable names to the table:
<?php
$con = mysql_connect("sqlserver", "login", "password");
if (!con)
{
die('Could not connect: '. mysql_error());
}
mysql_select_db("dbname", $con);
$sql = 'INSERT INTO `dbname`.`outage` (`id`, `date`, `time`, `outagetype`, `mtcplant`, `city`, `node`, `services`, `custcount`, `cbs`, `impact`, `desc`) VALUES (NULL, \'{$_POST[\'\'date\'\']}\', \'{$_POST[\'\'time\'\']}\', \'{$_POST[\'\'outagetype\'\']}\', \'{$_POST[\'\'mtcplant\'\']}\', \'{$_POST[\'\'city\'\']}\', \'{$_POST[\'\'node\'\']}\', \'{$_POST[\'\'services\'\']}\', \'{$_POST[\'\'custcount\'\']}\', \'{$_POST[\'\'cbs\'\']}\', \'{$_POST[\'\'impact\'\']}\', \'{$_POST[\'\'desc\'\']}\');';
if (!mysql_query($sql,$con))
{
die('Error: ' . mysql_error());
}
echo "Table successfully updated.";
mysql_close($con)
?>
I got that just using a mysql command to write the data directly into the table and then using phpMyAdmin to generate php code for it. The script processes correctly and just inserts the variable names instead of the variable values.
Thinking it was a magic quotes problem, I turned magic quotes off in my control panel and changed the code to this (just the $sql= line since that's all I changed:
$sql = "INSERT_INTO `dbname`.`outage` (`id`,`date`,`time`,`outagetype`,`mtcplant`,`city`,`node`,`services`,`custcount`,`cbs`,`impact`,`desc`) VALUES
(NULL,{$_POST['date']},{$_POST['time']},{$_POST['outagetype']},{$_POST['mtcplant']},{$_POST['city']},{$_POST['node']},{$_POST['services']},{$_
POST['custcount']},{$_POST['cbs']},{$_POST['impact']},{$_POST['desc']})";
I also tried surrounding each variable name structure with single quotes like: '{$_POST['date']}' and that didn't work either. In both of the last examples the script has no output, just a blank page.