|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Thu Jun 19, 2014 2:49 pm
Inserting SET values in MySql |
CMUD Pro 3.34
MySQL 5.5.36
I have a script to capture item stats into a CMUD database record. Once all of the stats are received, I use the record set returned from %sql() to either $row.Insert() or $row.update(), depending on whether the item is already in the database. I then set values for various columns in the row...
$row.Item("name") = %concat(%db(@itemStats,name))
$row.Item("level") = %db(@itemStats,level)
$row.Item("location") = %concat(%db(@itemStats,location))
I finish it up with a call to $row.Post().
Everything is working except the SET columns, like the "location" column. Depending on how I format the text in %db(@itemStats,location), I either get ONLY the first value or I get nothing at all...
<string> <value>
right_hand,left_hand -> right_hand
'right_hand','left_hand' -> nothing
('right_hand','left_hand') -> nothing
If anyone knows what I'm doing wrong, I'd greatly appreciate some help.
Thanks |
|
|
|
Daern Sorcerer
Joined: 15 Apr 2011 Posts: 809
|
Posted: Thu Jun 19, 2014 5:34 pm |
Haven't tested, but at a glance at the mysql documentation, it looks like the syntax should be 'right_hand, left_hand'.
|
|
|
|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Thu Jun 19, 2014 6:01 pm |
Yeah, that's one of the 3 versions I've tried. It yields no value for that column in the database.
Thanks |
|
|
|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Thu Jun 19, 2014 6:06 pm |
Scratch that... I misread your post. That's now one of the 4 versions I've tried. :)
It still leaves no value for that column in the database, though. :( |
|
|
|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Thu Jun 19, 2014 6:23 pm |
('right_hand,left_hand') also does not work. What am I missing here? :)
|
|
|
|
eupher Apprentice
Joined: 18 Jan 2001 Posts: 116 Location: USA
|
Posted: Thu Jun 19, 2014 6:28 pm |
Ok, I finally got it. For anyone else that might be trying to do this in the future... the syntax for the SET value must have:
No quotes of any kind
No space after the comma
Example: right_hand,left_hand
Thanks again for looking. |
|
|
|
|
|