title: Issue with JOIN in PHP MySQL
body: <p>Having a bit of a struggle here with adding JOINs to a query. I am connecting to two separate databases (on the same server). For this reason, I am writing this mysqli simply and will convert to a prepared statement once it's working.</p>
  
  <pre><code>// REMOVED: DB VARIABLES
  
  $conn = new mysqli($servername, $username, $password, $db_connective_data);
  if ($conn-&gt;connect_error) { die("Connection failed: " . $conn-&gt;connect_error); }
  $conn2 = new mysqli($servername, $username, $password, $db_resources);
  if ($conn2-&gt;connect_error) { die("Connection failed: " . $conn2-&gt;connect_error); }
  
  $sql = "SELECT * FROM downloads LEFT JOIN resource_data ON downloads.resource_id_REF=resource_data.resource_id WHERE downloads.user_basics_id_REF='$user_id'";
  $result = $conn-&gt;query($sql);
  
  $number_of_download_rows_returned = mysqli_num_rows($result) -1;
  
  if ($result-&gt;num_rows &gt; 0) {
      while($row = $result-&gt;fetch_assoc()) {
          $resource_id_REF[] = $row['resource_id_REF'];
          $download_date[] = date('Y-m-d', strtotime($row['download_date']));
          $resource_title[] = $row['resource_title'];
          $resource_title_link[] = str_replace(" ", "-", $row['resource_title']);
      }
  }
  
  $conn-&gt;close();
  </code></pre>
  
  <p>A query without a JOIN works fine (albeit without returning the resource_title):</p>
  
  <pre><code>$sql = "SELECT * FROM downloads WHERE downloads.user_basics_id_REF='$user_id' ORDER BY downloads.download_date DESC";
  </code></pre>
  
  <p>What am I missing here? The first code sample will return no results. The second one will return three. </p>
  
  <p>Any assistance is greatly appreciated.</p>
  
  <p>Here is a list of the different database names that I reference. As I stated, some data is in the "connective_data" db and some is in the "resources" db.</p>
  
  <pre><code>$db_connective_data = "connective_data";
  $db_lists = "lists";
  $db_messaging = "messaging";
  $db_resources = "resources";
  $db_users = "users";
  </code></pre>
  
  <p>I can't seem to get two of them connected. Am I missing something strikingly obvious here?</p>