title: Use echo inside of a query
body: <p>I need to include the <strong>value</strong> of an object returned by the linkedIn API on sign-in. When I assign the value of the returned ID to a php variable, I can simply <code>echo</code> back the variable which outputs the proper ID. However, when I try to include the variable storing the ID in a query, the query reads the linkedIn JS code literally rather than just retrieving the value.</p>
  
  <p>Ok that probably made no sense at all, so here is an example:</p>
  
  <pre><code>$someVar = "&lt;?js= id ?&gt;";
  echo $someVar; // Outputs: MD93l2jdJ
  
  $sql = "select * from myTable where my_col = $someVar";
  </code></pre>
  
  <p>In the above query, the server is reading <code>$someVar</code> to be <code>&lt;?js= id ?&gt;</code> rather than <code>MD93l2jdJ</code></p>
  
  <p>So, is there some way I can use <code>echo</code> within the query as in...</p>
  
  <pre><code>$sql = "select * from myTable where my_col = echo $someVar";
  </code></pre>
  
  <h2>EDIT</h2>
  
  <p><code>&lt;?js is LinkedIn Jargin</code> - see here: <a href="https://developer.linkedin.com/documents/getting-started-javascript-api" rel="nofollow">https://developer.linkedin.com/documents/getting-started-javascript-api</a></p>
  
  <p>Thanks!</p>