Hi all, I can't connect to Database for an unknown reason... would appreciate any help you can offer. The code is below.
The code is from the previous supplier to my current client, and the programmer isn't around anymore to ask.
Maybe it's something to do with the PHP?
<?php include('../include/config.php'); include(INC_PATH.'common.php'); include(INC_PATH.'sixheadtemplate/SiXhEaD.Template.php'); // Template page define('LIST_PAGE', TP_PATH.'_tp_main.html'); define('LAYOUT', TP_PATH.'_tp_layout.html'); define('TABLE_NAME', 'diplomat_car_member_db'); // Database connection & tracker message $oDB = new DBI(); if ($bDebug) { $oErr = new Tracker(); $oDB->SetTracker($oErr); } // Assign Table $oTable = new DBTableDef(); $oTable->GetTableDef($oDB, TABLE_NAME); /*++++++++++++++++++++++++++++++++ START PROGRAM +++++++++++++++++++++ ++++++++++++*/ $sAct = $_REQUEST['act']; $oLogin = new LoginManager(); if ($sAct == 'login') { $sUser = $_POST['user']; $sPass = $_POST['pass']; $oLogin->SetDBConnection($oDB); if (!$oLogin->Login($sUser, $sPass)) { $msg = 'Login incorrect, please try again.'; } elseif ($oLogin->IsAdmin()) { DoRedirect($oLogin->SelectPage()); exit(); } else { DoRedirect($oLogin->SelectPage()); exit(); } } elseif ($sAct == 'logout') { if (sizeof($_SESSION) > 0) { foreach ($_SESSION as $sKey => $sVal) { if (substr($sKey, 0, 3) == 'au_') { session_unregister($sKey); } } } } else { $msg = ''; } $tp = new template(LIST_PAGE); $tp->Display(); /*++++++++++++++++++++++++++++++++ END PROGRAM +++++++++++++++++++++++ ++++++++++*/ // Close DB conection & show tracker message if ($bDebug) { echo($oErr->GetAll()); } $oDB->Close(); ?>

I'm here as a proxy for my programmer who can't speak english too well, so any thing you ask I will have to pass onto her.
Thanks again.

polapat.leenutaphong@u5okyolk.com


In reply to (OT) Can't connect to DB by u5okyolk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.