I can't get this to work, it is not posting data to the database, I am completely new to this and any help is great!
<?php
$connection = mysql_connect('server', 'user', 'pass') or die(mysql_error());
mysql_select_db('db') or die(mysql_error());
$client = $_POST['client'];
$date = $_POST['date'];
$amount = $_POST['amount'];
$sql = "INSERT INTO $sales (client, date, amount) VALUES ('$client', '$date', '$amount')";
$result = mysql_query($sql, $connection);
if ($result) {
echo "Successful";
echo "<BR>";
echo "<a href='insert.php'>Back to main page</a>";
} else {
echo "ERROR";
}
?>