Location: PHPKode > projects > AJAX MySQL Admin > ajaxmysqladmin/www/api/inc/generic_start.inc
<?php
    $dbhost = null;
    $dbport = 0;
    $dbuser = null;
    $dbpass = null;
    $dbname = null;
    $username = $_SERVER['PHP_AUTH_USER'];
    $shown = false;

    $app_conn = @mysql_connect ('localhost', 'scaffold', 'databas3') or die (mysql_errno().': '.mysql_error().NL);
    mysql_select_db ("scaffold", $app_conn);

    if ($username == '') die ();

    $query  = "SELECT dbhost, dbport, dbuser, dbpass, dbname FROM connections WHERE username='" . $username . "'";

    $result = mysql_query ($query, $app_conn);
    if ($result !== FALSE && mysql_num_rows ($result) > 0) {
        while($row = mysql_fetch_array ($result, MYSQL_ASSOC)) {
            $dbhost = $row['dbhost'];
            $dbport = $row['dbport'];
            $dbuser = $row['dbuser'];
            $dbpass = $row['dbpass'];
            $dbname = $row['dbname'];
        }
        mysql_free_result ($result);
    }
?>
Return current item: AJAX MySQL Admin