Well, in my experience I can tell you that as long as your text is enclosed by quotes and has all the quotes commented, wich is automagically done by the magic quotes enabled, your SQL statement will be secure.
Besides, you can work on the security permisions; most of the times, when a select statement is enough, you can use a user with only that priviledge.
Hope it helped.
You can find a bunch of articles about the subject in Devshed.