Unknown column in 'where clause'
I let DataAssist create my product management pages for the admin of my web store, My product numbers look like G35-024-68 but after I add a new product I get the following code if I try to go to the detail, update, or delete page - Unknown column 'G35' in 'where clause'.
In my database I have the ID column set for varchar (10) and it is the primary.
My record set for the detail page looks like the following
<?php
$ParamID_WADAitems = "-1";
if (isset($_GET['ID'])) {
$ParamID_WADAitems = (get_magic_quotes_gpc()) ? $_GET['ID'] : addslashes($_GET['ID']);
}
$ParamSessionID_WADAitems = "-1";
if (isset($_SESSION['WADA_Insert_items'])) {
$ParamSessionID_WADAitems = (get_magic_quotes_gpc()) ? $_SESSION['WADA_Insert_items'] : addslashes($_SESSION['WADA_Insert_items']);
}
mysql_select_db($database_connTigermodels, $connTigermodels);
$query_WADAitems = sprintf("SELECT ID, Name, Category, Era, Nationality, Scale, ShortDesc, LongDesc, Price, Weight, Inventory, InventoryShow, InventoryDate, MainImage, Image1, Image2, Image3, Image4, Image5, Image6, Visibility, Details, MasterMaker FROM items WHERE ID = %s OR ( -1=".$ParamID_WADAitems." AND ID= %s)", $ParamID_WADAitems,$ParamSessionID_WADAitems);
$WADAitems = mysql_query($query_WADAitems, $connTigermodels) or die(mysql_error());
$row_WADAitems = mysql_fetch_assoc($WADAitems);
$totalRows_WADAitems = mysql_num_rows($WADAitems);
?>
If I take out both the letter and the dashes the pages work. How can I make it work with out taking those out?
Any Ideas?