Drupal db_query trimming leading 0

The Drupal db_query was killing my leading zeros. According to this post I added single quotes and it seems to work fine now. This is in MySql 5.x and Drupal 5.7.


$query = db_query("select active from {active} where name= %s", array($user->name));


$query = db_query("select active from {active} where name = '%s'", array($user->name));

I would have added single quotes anyway but the api doc said not to.

Valid %-modifiers are: %s, %d, %f, %b (binary data, do not enclose in ”) and %%.