title: PHP using a variable in a mysql query with magic_quotes
body: <p>I have a mysql query that uses a value in an array as part of the WHERE statement. How am I supposed to include this variable?</p>
  
  <p>Here is the sql:
  <code>"AND gender = '{$user_array[\"gender\"]}'"</code></p>
  
  <p>PHP returns this error: <code>Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_STRING</code></p>
  
  <p>I have <code>magic_quotes</code> turned on. I've seen some posts suggesting setting the array's value to another variable, but seems unnecessary if I have magic quotes. Is this correct?</p>