close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues


Unknown column in 'where clause'

Thread began 9/20/2010 2:35 pm by Bknvc1111729 | Last modified 9/21/2010 10:23 am by Jason Byrnes | 1076 views | 2 replies |


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

$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?

Sign in to reply to this post


Okay that was easy, I think. I rewrote the WHERE cluase and did away with the preconfigured cluase that the program wrote during the creation of the pages. Everthing seems to be working okay.

Sign in to reply to this post

Jason ByrnesWebAssist

Glad to hear you have it working. Just one note:

It is best practice for your ID column to be a number column and set it to auto number so the database can automatically assign the index value.

You can always create a second column for product sku that can be set to a varchar column.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...