Basil wilting, how to preserve? I have a hard time keeping basil.

When I buy it from a local grocery store, it is perfectly fresh, but when I take it home it withers in a couple of days.

I have tried keeping it in fresh water and trimming the stems, but that only extends its life about 48 hours. My current record is 3 days before it goes bad, and I only got that by trimming and replacing water every 16 hours.

What is the secret here? How can I keep the basil alive?
Don't try and keep it alive. Wrap it in plastic wrap and freeze it. It will thaw in seconds under running water. Freezing will do little harm to the flavour.