Unknown column in 'where clause' error
Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Unknown column in 'where clause' error
On Mon, Jun 18, 2001 at 02:44:00PM -0400, Shrout, Ryan wrote: Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Try: SELECT * FROM customers WHERE Customer_No = CMET3558539239; Greetz, Peter -- Against Free Sex! http://www.dataloss.nl/Megahard_en.html - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
Re: Unknown column in 'where clause' error
Put quotes around the Customer_No: SELECT * FROM customers WHERE Customer_No = 'CMET3558539239' - TIM Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Unknown column in 'where clause' error
Try SELECT * FROM customers WHERE Customer_No = 'CMET3558539239' Jorge Oliveira [EMAIL PROTECTED] © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Enviada: Segunda-feira, 18 de Junho de 2001 19:44 Para: '[EMAIL PROTECTED]' Assunto: Unknown column in 'where clause' error Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Unknown column in 'where clause' error
Thanks for the suggestions, but this is actually a variable that is passed via a URL. For example: http://localhost/cus-lookup.php?id=CMET3558539239 Then in the code it looks like this: $customer_select=SELECT * FROM customers WHERE Customer_No = $id; How can I 'put quotes around' a variable? Ryan Shrout -Original Message- From: Bill Elvis Gibbs [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 3:20 PM To: Shrout, Ryan Subject: RE: Unknown column in 'where clause' error WHERE Customer_No = 'CMET3558539239' you need to use quotes when trying to reference data that is not 100% numeric, otherwise MySQL thinks you are trying to reference a column. Bill Elvis Gibbs goEbusiness.com - putting e-motion in your business email - [EMAIL PROTECTED] work - 301-668-5090 cell - 301-748-6938 -Original Message- From: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 2:44 PM To: '[EMAIL PROTECTED]' Subject: Unknown column in 'where clause' error Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Unknown column in 'where clause' error
Hello, Your field(column) is a CHAR and therefore the parameter to it should be in single quotes: Change your query to: SELECT * FROM customers WHERE Customer_No = 'CMET3558539239' * * Visit http://www.computerstaff.net - Computer Jobs at all LEVELS * * -Original Message- From: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Sent: 18 June 2001 19:44 To: '[EMAIL PROTECTED]' Subject: Unknown column in 'where clause' error Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Unknown column in 'where clause' error
You are using PHP. Well PHP is not ASP :-) clever and you can enclose your variable in single quotes as in: $customer_select=SELECT * FROM customers WHERE Customer_No = '$id'; Hope this helps. * * Visit http://www.computerstaff.net - Computer Jobs at all LEVELS * * -Original Message- From: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Sent: 18 June 2001 20:14 To: '[EMAIL PROTECTED]' Subject: RE: Unknown column in 'where clause' error Thanks for the suggestions, but this is actually a variable that is passed via a URL. For example: http://localhost/cus-lookup.php?id=CMET3558539239 Then in the code it looks like this: $customer_select=SELECT * FROM customers WHERE Customer_No = $id; How can I 'put quotes around' a variable? Ryan Shrout -Original Message- From: Bill Elvis Gibbs [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 3:20 PM To: Shrout, Ryan Subject: RE: Unknown column in 'where clause' error WHERE Customer_No = 'CMET3558539239' you need to use quotes when trying to reference data that is not 100% numeric, otherwise MySQL thinks you are trying to reference a column. Bill Elvis Gibbs goEbusiness.com - putting e-motion in your business email - [EMAIL PROTECTED] work - 301-668-5090 cell - 301-748-6938 -Original Message- From: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 2:44 PM To: '[EMAIL PROTECTED]' Subject: Unknown column in 'where clause' error Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Unknown column in 'where clause' error
Like this: $customer_select=SELECT * FROM customers WHERE Customer_No = '$id'; Jorge Oliveira [EMAIL PROTECTED] --- © webfroggie.com - Recursos Online! web: http://www.webfroggie.com wap: http://www.webfroggie.com -Mensagem original- De: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Enviada: Segunda-feira, 18 de Junho de 2001 20:14 Para: '[EMAIL PROTECTED]' Assunto: RE: Unknown column in 'where clause' error Thanks for the suggestions, but this is actually a variable that is passed via a URL. For example: http://localhost/cus-lookup.php?id=CMET3558539239 Then in the code it looks like this: $customer_select=SELECT * FROM customers WHERE Customer_No = $id; How can I 'put quotes around' a variable? Ryan Shrout -Original Message- From: Bill Elvis Gibbs [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 3:20 PM To: Shrout, Ryan Subject: RE: Unknown column in 'where clause' error WHERE Customer_No = 'CMET3558539239' you need to use quotes when trying to reference data that is not 100% numeric, otherwise MySQL thinks you are trying to reference a column. Bill Elvis Gibbs goEbusiness.com - putting e-motion in your business email - [EMAIL PROTECTED] work - 301-668-5090 cell - 301-748-6938 -Original Message- From: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 2:44 PM To: '[EMAIL PROTECTED]' Subject: Unknown column in 'where clause' error Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
RE: Unknown column in 'where clause' error
Ok, in your PHP code, do this: $customer_select=SELECT * FROM customers WHERE Customer_No = '$id'; This will add quotes around the variable... -TIM On Mon, 18 Jun 2001, Shrout, Ryan wrote: Thanks for the suggestions, but this is actually a variable that is passed via a URL. For example: http://localhost/cus-lookup.php?id=CMET3558539239 Then in the code it looks like this: $customer_select=SELECT * FROM customers WHERE Customer_No = $id; How can I 'put quotes around' a variable? Ryan Shrout -Original Message- From: Bill Elvis Gibbs [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 3:20 PM To: Shrout, Ryan Subject: RE: Unknown column in 'where clause' error WHERE Customer_No = 'CMET3558539239' you need to use quotes when trying to reference data that is not 100% numeric, otherwise MySQL thinks you are trying to reference a column. Bill Elvis Gibbs goEbusiness.com - putting e-motion in your business email - [EMAIL PROTECTED] work - 301-668-5090 cell - 301-748-6938 -Original Message- From: Shrout, Ryan [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 2:44 PM To: '[EMAIL PROTECTED]' Subject: Unknown column in 'where clause' error Here is the full error I am getting when running the query included: Failed Query: SELECT * FROM customers WHERE Customer_No = CMET3558539239 1054 : Unknown column 'CMET3558539239' in 'where clause' Here's the problem, I know that Customer_No exists. I can see it in the database. This code works fine when using a Customer_No such as 15 or 153, something numeric. The field itself is defined as a CHAR (50). Any ideas what is causing this? It happens with every Customer_No in this format and gives the same error. Ryan Shrout - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php - Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail [EMAIL PROTECTED] To unsubscribe, e-mail [EMAIL PROTECTED] Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php