title: Export users and their profiles from Drupal 6 database
body: <p>As the title says: I'm a newbie drupal user and I need to automatize the export of the "username" from the table user and some related fields from the "content_type_profile" table. 
  I guess I shouldn't use any kind of module to try to get out this data since I need to run a script and generate a separated data from the html page and generate a pdf as it is needed. So I tried to join togheter both of the tables by using:</p>
  
  <pre><code>select name, field_username_value, field_surname_value from users as u inner join content_type_profile as p on u.uid = p.vid; 
  </code></pre>
  
  <p>But I found out that the uid and the vid in the content table doesn't match and I can't find where is the third table I need to get this relation working. I can't find any documentation which simply explaines how Drupal manage these content_type tables either. 
  - How can achieve this kind of export from the Drupal db? 
  - Can anyone please point me out to which documents do I need to read to achieve my goal?</p>
  
  <p>Thanks guys</p>