Chuck Gartland wrote:
> //get quanity available for this SKU
> $Query = "SELECT i.Available, i.Reserve, i.Backorder ";
> $Query .= "FROM inventory i, invoice_sku is ";
> $Query .= "WHERE is.ID = $sku_ID ";
> $Query .= "AND is.SKU = i.SKU ";
ERROR 1064: You have an error in your SQL syntax near
'is where is.ID=2 AND is.SKU=i.SKU' at line 1
In other words, "is" is a reserved word. You've probably
figured that out by now though... Hopefully you've learned
from this that if there's any doubt in a query then you
should run it manually to see what happens.
BTW, I think the way FreeTrade does queries leaves
something to be desired. A library function which performs
the queries and reports errors would make it much more
convenient to catch errors like this. In fact, a library
function which does a query, complains about errors, and
returns a single row from the result would reduce the
freetrade code considerably and make a big improvement in
the error detection. Of course, less code means less bugs
and easier maintenance.
I'd rework it for my favorite abstraction layer if I thought
the changes would be integrated into the project. But I'd
also want to give in to the temptation to put nearly all the
code into functions too.
--
Paul Chamberlain, [EMAIL PROTECTED]
_______________________________________________
FreeTrade-dev mailing list
[EMAIL PROTECTED]
http://share.whichever.com/mailman/listinfo/freetrade-dev