error getting is...
=======================================
PHP error happened Technical information
Error type 256
Error description 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 'and event_time_end>=' at line 2
URL 192.168.1.100/moonjump/order_items_add.php?
Error file D:\vhosts\mj4u\output\include\dbconnection.php
Error line 34
SQL query select sum(Qty_Order) from event_times where Order_ID!=44 and event_time_start<= and event_time_end>=
Solution This is a general error. It occurs when there is an error in event code or in SQL.
===================================================================
{
$str1 = "select event_time_start,event_time_end,Qty_Order from event_times where Order_ID=".$_SESSION[$strTableName."_masterkey1"];
$rsh1 = db_query($str1,$conn);
while ($data1= db_fetch_array($rsh1))
$strSelect = "select event_time_start,event_time_end,Qty_Order from event_times where Order_ID!=".$_SESSION[$strTableName."_masterkey1"]."
and event_time_start<=".$data1["event_time_start"]." and event_time_end>=".$data1["event_time_start"];
$rsSelect = db_query($strSelect,$conn);
$strSelect1 = "select sum(Qty_Order) from event_times where Order_ID!=".$_SESSION[$strTableName."_masterkey1"]."
and event_time_start<=".$data1["event_time_start"]." and event_time_end>=".$data1["event_time_start"];
$rsSelect1 = db_query($strSelect1,$conn);
$data2 = db_fetch_array($rsSelect1);
{
if ($dataSelect = db_fetch_array($rsSelect) && $data1["Qty_Order"] >= $data2["Qty_Order"])
{
//echo ($rsSelect);
//echo ($rsh1);
echo "<font color=red><big><b>ITEM RESERVED FOR SAME DATE ON ANOTHER ORDER</b></big></font>, please select another item or goto list to edit current";
return false;
================================================
Now mind you before some go off on this, the code works fine when eliminating the questionable sum of Qty_Order, my guess is that because I am using the ! command to nulify a specifc order_id being used is my problem. Without the sum ofcourse it all works, but I need to add all feilds that fall within the given timestamps and values.
Any thoughts from anyone and ofcourse the admins would be great!
Thnx,
Noel