2 Replies - 169 Views - Last Post: 24 September 2017 - 11:46 AM

#1 dak45309  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 155
  • Joined: 22-April 13

Stored Procedure Erroring on Input

Posted 23 September 2017 - 08:36 PM

Hello all. I am trying to figure out why my Stored Procedure keeps producing this error (I found it after trying to test it through code and did a test in the SQL Query window after binding parameters with the values I'm using for testing):

SELECT `UserID`, `RegistrationDate`, `SubscriptionendDT` FROM `users` WHERE `Username` = dak45309 AND `fName` = Dustin AND `lName` = Koeller

1054 - Unknown column 'dak45309' in 'where clause'


Only problem is I haven't put tick marks around it to designate it as a column and there is no tick marks in the text box of the webpage. It's to tell the system who referred the person to the site and I have used PDO to connect and do database transactions. Any help?

Is This A Good Question/Topic? 0
  • +

Replies To: Stored Procedure Erroring on Input

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 13389
  • View blog
  • Posts: 53,429
  • Joined: 12-June 08

Re: Stored Procedure Erroring on Input

Posted 23 September 2017 - 09:41 PM

Typically column names do not need tick marks around them, but varchar strings do.

Example: 'this is a string'

Since dak45309 is not shown to be a string the query thinks it is a column name.
Was This Post Helpful? 0
  • +
  • -

#3 dak45309  Icon User is offline

  • D.I.C Head

Reputation: 4
  • View blog
  • Posts: 155
  • Joined: 22-April 13

Re: Stored Procedure Erroring on Input

Posted 24 September 2017 - 11:46 AM

I did this with a bind parameters in the phpmyadmin for testing. Any way I would get it to show as a string because I tried 'dak45309' in the bind parameters box it errored saying \'dak45309\' with an unexpected \
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1