Here is my total code from top down to the function, can anyone see a problem on why i would get the error
"You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1" for the function, i know its the function thats erroring and i know its not the MySQL connection because it works later on in the page
<?php require_once('../MyConnecitonsFileHere.PHP'); ?>
<?php
//The Database record set
mysql_select_db($database_AmmoBox, $AmmoBox);
$query_ViewOrders = "SELECT * FROM orders WHERE Processed = '0'";
$ViewOrders = mysql_query($query_ViewOrders, $AmmoBox) or die(mysql_error());
$row_ViewOrders = mysql_fetch_assoc($ViewOrders);
$totalRows_ViewOrders = mysql_num_rows($ViewOrders);
//Create the Process function
if (isset($_GET['action'])) //If the varible action is set
{
if ($_GET['action'] == 'ProcessOrder') //And the varible is ProcessOrder
{
ProcessOrder(); // Run the ProcessOrder function
}
}
function ProcessOrder()
{
echo $_GET['id'];
echo 'The Function Works';
mysql_query("SELECT processed FROM orders WHERE id=".$_GET['id']);
mysql_query("UPDATE orders SET processed = '1' WHERE id=".$_GET['id']) or die(mysql_error());
return;
}
Many Thanks
Chris