I should've looked deeper into the code .. it's a very complex query that is dynamically generated, and it looks as though the constructed values string is plugged in directly rather than using %s substitution. That explains it, I guess.
<br><br>Thanks for the help<br><br><div><span class="gmail_quote">On 9/3/07, <b class="gmail_sendername">Henrique Recidive</b> <<a href="mailto:recidive@gmail.com">recidive@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hello,<br><br>take a look at how variable_set does this:<br><br><a href="http://api.drupal.org/api/function/variable_set/5">http://api.drupal.org/api/function/variable_set/5</a><br><br>Henrique<br><br>2007/9/3, William Smith <
<a href="mailto:william.darren@gmail.com">william.darren@gmail.com</a>>:<br>> Hi all -<br>><br>> I have an sql query that needs to insert a serialized array as one of the<br>> columns. However, the serialized data never makes it properly into the DB,
<br>> I think because db_query strips out the curly braces. Take the following<br>> serialized associative array:<br>><br>> 'a:2:{s:10:"Cardiology";s:10:"Cardiology";s:11:"Dermatology";s:11:"Dermatology";}'
<br>> This ends up being stored as<br>> 'a:2:s:10:"Cardiology";s:10:"Cardiology";s:11:Dermatology";s:11:Dermatology";'<br>> (no curly braces), and I am therefore unable to unserialize() it.
<br>><br>> What is the way around this, other than fudging it and taking my result as a<br>> string and manually pushing the curly braces into place before attempting to<br>> unserialize?<br>><br>> Thanks,
<br>> William<br>><br>><br></blockquote></div><br>