Query needs single quote added

Ashford - December 21, 2008 - 08:17
Project:Workflow-NG: Profile Action
Version:5.x-1.x-dev
Component:User interface
Category:support request
Priority:normal
Assigned:Unassigned
Status:active
Description

Error message:

* user warning: Unknown column 'Pogo' in 'field list' query:
INSERT INTO profile_values (fid,uid,value) VALUES (2,3,Abc)

Doesn't the text listed in VALUES( ) need single quotes: VALUES (2,3,'Abc') ?

And, thank you for sharing this module. The function will be useful for our volunteer organization's web site.

#1

Ashford - December 21, 2008 - 09:01

Repeat, due to error in my typing. By the way, I am using Token values for the entry.

Error message:

* user warning: Unknown column 'Abc' in 'field list' query:
INSERT INTO profile_values (fid,uid,value) VALUES (2,3,Abc)

Doesn't the text listed in VALUES( ) need single quotes: VALUES (2,3,'Abc') ?

#2

mr.andrey - December 21, 2008 - 15:48

It probably does need quotes. Here's how I use it on our store: http://drupal.org/node/299478. "value" there stands for the field, so no need of quotes, but if you're using a specific value, you probably do need them.

Best,
Andrey.

#3

Ashford - December 21, 2008 - 17:03

Hi there, Andrey. I appreciate your quick reply. I tried it with the double and single quotes and it tossed out another error. Maybe there is another process to add when using Tokens?

Entered the Operation and Default Value as a CCK text token, with the single quotes.

'[node:field_app_fname-raw]'

The quotes produced the error:

user warning: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '\'Joe\')' at line 1 query:

INSERT INTO profile_values (fid,uid,value)
VALUES (1,5,\'Joe\')

in C:\wamp\www\drupal\includes\database.mysqli.inc on line 156.

#4

mr.andrey - December 21, 2008 - 17:06

Ah, now I get what you're trying to do. You need the actual token value to be enclosed in the quotes.

Hmm... not sure about that. Maybe there's a drupal syntax for not escaping the quotes?

 
 

Drupal is a registered trademark of Dries Buytaert.