Simply trying to update my sql database via php and jquery ajax. It is loading the Unique ID so I know it is passing through to the database, its just that there is no other data that it is passing.
For my first page:
<script>
$.post("kpi.php", { orders: '15'}, function(data) {
alert("Data Loaded: " + data);
});
</script>
This returns “Data Loaded: 0” and adds a unique ID to the database with ‘ORDERS’ blank.
Here is kpi.php:
<?php
$con = mysql_connect("domain.fatcowmysql.com","user","pass");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("ga", $con);
mysql_query("INSERT INTO kpi (ORDERS) VALUES ('$orders')");
mysql_close($con);
?>
Any ideas on how to get that number “15” passed through to the database from my first page?
If i understood your question correctly,
$_POST['orders']is what you want.