title: Search function in PHP works with numeric values but doesn't work with letters/words
body: <p>People can order links at my platform and these get stored in two different tables, eg wp_project and wp_articles. The reason for this is that when people place an order for 1 link one project row gets created and one article row gets created.</p>
  
  <p>However if a client orders 10 links there will be one project entry and ten article entries. Now this isn't very relevant to my problem but just to explain how the system works.</p>
  
  <p>There are two common identifiers for projects and articles, both the ID and the project title are stored in both inpu_project and inpu_articles.</p>
  
  <p>Now if I want to echo all the links from one project I built a search function where I can select the project ID, click search and whether a client ordered 1 link or 20 links that amount of links will show.</p>
  
  <p>The problem starts when I want to search based on the project title instead of ID, which is non-numeric but just words (with spaces in between sometimes).</p>
  
  <p>This to prevent the error undefined index in my error logs</p>
  
  <pre><code>    $where_clouse='';
  </code></pre>
  
  <p>This is the search function based on the project title:</p>
  
  <pre><code>    if(isset($_GET['todo']) &amp;&amp; $_GET['todo']=='search')
      {
          if($_GET['proid']!=0){
              $where_clouse.=' AND P.`project_title`='.$_GET['proid'];
          }
      }
  </code></pre>
  
  <p>This is the database query to pull the links from it:</p>
  
  <pre><code>    $sql="SELECT P.`project_title`, P.`backlink` FROM `inpu_articles` AS P 
  WHERE P.`post_it_posted` = '1' ".$where_clouse."  ORDER BY P.`project_title`  ASC";
      $backlinks=$wpdb-&gt;get_results($sql, ARRAY_A);
  </code></pre>
  
  <p>This is the actual search function that triggers the first code I pasted:</p>
  
  <pre><code>    &lt;p&gt;Select a project title and hit search!&lt;/p&gt;
      &lt;form action="" method="get"&gt;
          &lt;input type="hidden" name="todo" id="todo" value="search" /&gt;
          &lt;select name="proid" id="proid"&gt;
          &lt;option value="0"&gt;All Projects&lt;/option&gt;
          &lt;?php $projects=getTitles(); foreach($projects as $project){ ?&gt;
              &lt;option value="&lt;?php echo $project['title']; ?&gt;" &lt;?php if(isset($_GET['proid']) &amp;&amp; $_GET['proid']==$project['title'] ) { echo 'selected="selected"';  } ?&gt; &gt;&lt;?php echo $project['title'] ?&gt;
              &lt;/option&gt;
          &lt;?php } ?&gt;
          &lt;/select&gt;
          &lt;input class="submit_search" type="submit" id="search_button" value="Search"/&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>And this is the code that pulls the project titles from the project table:</p>
  
  <pre><code>    function getTitles($where=false)
      {
          global $wpdb;
          $sql="SELECT  `title`, `link` FROM `inpu_project` WHERE `link`='1' ORDER BY `title` ASC";
          $result = $wpdb-&gt;get_results($sql, ARRAY_A);
          return $result;
      }
  </code></pre>
  
  <p>All pretty straight forward and it works 100% fine if I replace the non-numeric title in the code for both the inpu_articles and the inpu_project tables with the numeric id.</p>
  
  <p>Then the code does exactly what it does, but when I use the project title instead it just shows ALL of the links that every client ever ordered and no error shows up in my database. It's like it can't find a match or something, which is plain weird.</p>
  
  <p>So am I missing something here? Is it not possible to match words or is there something that I should adjust when using words instead of numeric values?</p>
  
  <p>Lastly, for what it's worth, this is the code that echos the query:</p>
  
  <pre><code>    &lt;?php foreach ($backlinks as $backlink) {
          $backlink_overview=$backlink['backlink'];
      ?&gt;
          &lt;ul&gt;
              &lt;li&gt;&lt;?php echo $backlink_overview; ?&gt;&lt;/li&gt;
          &lt;/ul&gt;
      &lt;?php } ?&gt;
  </code></pre>
  
  <p>The titles do show up in my form / search drop down menu so I am surprised it can't match the project title with the title that's stored in the article table.</p>
  
  <p>My gut says this is where it goes wrong:</p>
  
  <pre><code>    P.`project_title`='.$_GET['proid'];
  </code></pre>
  
  <p>But it doesn't throw any syntax errors or any errors whatsoever, it just shows all the links that are stored in the inpu_article table, ignorning my search function altogether.</p>