title: Unable to prepare sqli
body: <p>I can't figure out what is wrong with this code.</p>
  <pre><code>if($link === false)
      echo &quot;I am not connected to DB&lt;br&gt;&quot; ;
  else
      echo &quot;I am connected to DB&lt;br&gt;&quot; ;
  
  if($stmt = $link-&gt;prepare(&quot;SELECT entitytype FROM entitytype WHERE entitytypeid = 3&quot;))
      echo &quot;Prepared&lt;br&gt;&quot; ;
  else
      echo &quot;Did NOT Prepare&lt;br&gt;&quot; ;
  </code></pre>
  <p>I know the query is valid, logged into PhPMyAdmin with the user, the query runs as expected.</p>
  <p>There is a page <em>test.php</em> that has <em>require_once &quot;functions.php&quot; ;</em></p>
  <p>There is a page <em>functions.php</em> that has <em>require_once &quot;config.php&quot; ;</em></p>
  <p>There is a page <em>config.php</em> that has</p>
  <pre><code>&lt;?php
  define('DB_SERVER', 'localhost') ;
  define('DB_USERNAME', 'hrmusers') ;
  define('DB_PASSWORD', 'my22@Pass') ;
  define('DB_NAME', 'hrm') ;
  $link = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME) ;
  if($link === false) {
      echo &quot;Could not connect&quot; ;
      die(&quot;ERROR: Could not connect. &quot; . mysqli_connect_error());
  } else {
      echo &quot;Connected to DB&lt;br&gt;&quot; ;
  ?&gt;
  </code></pre>
  <p>The page prints only</p>
  <pre><code>Connected to DB
  I am connected to DB
  </code></pre>
  <p>Thanks Brian</p>