本文整理汇总了PHP中DBConnect::setDatabase方法的典型用法代码示例。如果您正苦于以下问题:PHP DBConnect::setDatabase方法的具体用法?PHP DBConnect::setDatabase怎么用?PHP DBConnect::setDatabase使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBConnect
的用法示例。
在下文中一共展示了DBConnect::setDatabase方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: checkLogin
* FluencyTool Enviroment Configuration File.
* This sets all the enviroment variables such as which company is current logged in
* and what their images, colors, titles are.
*
* Company: RootLoud <http://www.rootloud.com>
* Application: FluencyTool <http://www.fluencytool.com>
* Programmer: David Duggins <david@rootloud.com>
* Created: 7/1/2010
* Last Updated: 7/6/2010
*/
require_once 'includes/global-inc.php';
//this loads all the required classes..changed from dbconnect.php on 7/6/10 DWD
//TODO: need to load the database here
$myFluencyDB = new DBConnect();
$myFluencyDB->setHost('localhost', 'root', '');
$myFluencyDB->setDatabase('fluency_tool');
$myFluencyDB->connectHost();
$myFluencyDB->connectDB();
//TODO: lookup org based on url (http://my.fluencytool.com/org_name_is_here)
//TODO: load the org config information
//validate the users
//TODO Take the is user validation function and turn it into a User class
function checkLogin($levels)
{
if (!$_SESSION['logged_in']) {
$access = FALSE;
} else {
$userid = $_SESSION['user_id'];
$userid = mysql_real_escape_string($userid);
$kt = split(' ', $levels);
$query = 'SELECT rolename FROM users INNER JOIN roles ON users.role = roles.ID WHERE users.ID = "' . $userid . '"';