SitePoint Sponsor |
|
User Tag List
Results 1 to 3 of 3
-
Feb 16, 2007, 03:30 #1
- Join Date
- May 2006
- Posts
- 457
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
problem with sql qurery - invalid column name
Hello all, im trying to execute the following:
SELECT * FROM BasketDetails b
INNER JOIN DesignDetails d ON b.CustomisedID = d.DesignID INNER JOIN Products p ON d.ProductID = p.ProductID INNER JOIN AffiliateMarkupPrice am ON am.DocumentID = d.DocumentID
WHERE b.UserID = gnrac055rnj3x555jfwakt45 AND b.CheckoutID = 0
Hwever, when I execute, I get the following error:
"invalid column name 'gnrac055rnj3x555jfwakt45'"
Any ideas?
-
Feb 16, 2007, 04:09 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
gnrac055rnj3x555jfwakt45 is a column name
'gnrac055rnj3x555jfwakt45' is a string value
you want the latter
-
Feb 16, 2007, 06:51 #3
- Join Date
- May 2003
- Location
- Washington, DC
- Posts
- 10,653
- Mentioned
- 4 Post(s)
- Tagged
- 0 Thread(s)
Actually, he wants a GUID and he probably should be using parameters to not worry about escaping things.
Bookmarks