title: Codeigniter MYSQL Returning Most Recent Row
body: <p>I have the following code below, and I am not sure of the best way to modify it so that it shows the last entered row into the database.</p>
  
  <p>The <code>user_date</code> column is displayed like this: <code>2010-05-06 12:37:28</code> </p>
  
  <p><strong>Controller:</strong></p>
  
  <pre><code>$result = $this-&gt;shared_model-&gt;GetJustJoinedUser();
      $data['just_joined_user'] = $result-&gt;row_array();
  </code></pre>
  
  <p><strong>Model:</strong></p>
  
  <pre><code>function GetJustJoinedUser()
  {
      $query = $this-&gt;db-&gt;query("SELECT *
                                FROM {$this-&gt;_table['users']} user
                                WHERE user_description != '' AND user_image != '' AND (user_twitter != '' OR user_youtube != '' OR user_vimeo!= '')
                                ORDER BY user_date DESC
                                LIMIT 1");
  
      return $query;
  }
  </code></pre>