Hello,

I'm building a custom node for a friend's website, and this is my first attempt. My goal is to build a node that provides some text along with six tabs, each containing unique content being pulled from other nodes. I'm using CCK and Javascript Tools (tabs plugin module) to create the node.

I've successfully set this up on my local environment (unix/mac) and the module test out ok. I've attempted to recreate the module in a live environment and I'm unable to connect to my mysql database.

The error is

Can someone tell me if there is something visibly wrong with this script? I'm just now learning php and have been using Drupal for some time. I cannot for the life of me figure what I'm doing wrong here.

Thanks,

Will


<?php 

 
class DBJT {
   function DB() {
       $this->host = "localhost";
       $this->db = "database";
       $this->user = "user";
       $this->pass = "pass";
       $this->link = mysql_connect($this->host, $this->user, $this->pass);
       mysql_select_db($this->db);
       register_shutdown_function($this->close);
   }
   function close() {
       mysql_close($this->link);
   }
}
 
$myyear = $_GET["year"];
 
    define(WC_DB_HOST, 'localhost');
    define(WC_DB_NAME, 'database');
    define(WC_DB_USER, 'user');
    define(WC_DB_PASS, 'pass');
   
mysql_connect (WC_DB_HOST, WC_DB_USER, WC_DB_PASS) or die("Couldn't connect to MySql");
mysql_select_db (WC_DB_NAME);
 
$result = mysql_query("select content_type_archive_item.*,node_revisions.title,node_revisions.body from node_revisions,content_type_archive_item where content_type_archive_item.field_archive_item_year_value = '$myyear' and content_type_archive_item.nid = node_revisions.nid  ");
 
while ($resultrow= mysql_fetch_array($result)) {
  $field_subtitle_value = $resultrow["field_subtitle_value"];
  $title = $resultrow["title"];
  $cat = $resultrow["category"];
 $i = $resultrow["field_archive_category_value"];
            switch ($i) {
            case "Overview":
                $overview = $resultrow["body"];
                break;
            case "Target Story":
                $target = $resultrow["body"];
                break;
            case "Reader":
                $reader = $resultrow["body"];
                break;
            case "Scripts":
                $scripts = $resultrow["body"];
                break;
            case "Company":
                $company = $resultrow["body"];
                break;
            case "Staff":
                $staff = $resultrow["body"];
                break;
               
            } // end of switch
 
} // end of while
 

$form = array();
  $form['container'] = array(
    '#type' => 'tabset',
  );
  $form['container']['tab1'] = array(
    '#type' => 'tabpage',
    '#title' => t('Overview'),
    '#content' => t("<br/><br/><br/>$overview"),
  );
  $form['container']['tab2'] = array(
    '#type' => 'tabpage',
    '#title' => t('Target Story'),
    '#content' => t("<br><br><br>$target"),
  );
  $form['container']['tab3'] = array(
    '#type' => 'tabpage',
    '#title' => t('Reader'),
    '#content' => t("<br><br><br>$reader"),
  );
  $form['container']['tab4'] = array(
    '#type' => 'tabpage',
    '#title' => t('Scripts'),
    '#content' => t("<br><br><br>$scripts"),
  );
 $form['container']['tab5'] = array(
    '#type' => 'tabpage',
    '#title' => t('Company'),
    '#content' => t("<br><br><br>$company"),
  );
 $form['container']['tab6'] = array(
    '#type' => 'tabpage',
    '#title' => t('staff'),
    '#content' => t("<br><br><br>$staff"),
  );

  return tabs_render($form);

?>