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> &lt;<a href="mailto:recidive@gmail.com">recidive@gmail.com</a>&gt; 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 &lt;
<a href="mailto:william.darren@gmail.com">william.darren@gmail.com</a>&gt;:<br>&gt; Hi all -<br>&gt;<br>&gt; I have an sql query that needs to insert a serialized array as one of the<br>&gt; columns.&nbsp;&nbsp;However, the serialized data never makes it properly into the DB,
<br>&gt; I think because db_query strips out the curly braces.&nbsp;&nbsp;Take the following<br>&gt; serialized associative array:<br>&gt;<br>&gt; &#39;a:2:{s:10:&quot;Cardiology&quot;;s:10:&quot;Cardiology&quot;;s:11:&quot;Dermatology&quot;;s:11:&quot;Dermatology&quot;;}&#39;
<br>&gt; This ends up being stored as<br>&gt; &#39;a:2:s:10:&quot;Cardiology&quot;;s:10:&quot;Cardiology&quot;;s:11:Dermatology&quot;;s:11:Dermatology&quot;;&#39;<br>&gt; (no curly braces), and I am therefore unable to unserialize() it.
<br>&gt;<br>&gt; What is the way around this, other than fudging it and taking my result as a<br>&gt; string and manually pushing the curly braces into place before attempting to<br>&gt; unserialize?<br>&gt;<br>&gt; Thanks,
<br>&gt; William<br>&gt;<br>&gt;<br></blockquote></div><br>