darkfreaks Posted June 17, 2009 Share Posted June 17, 2009 Code: <?php $db_server = "localhost"; $_SESSION['db_user'] = "root"; $db_user = $_SESSION['db_user']; $_SESSION['db_pass'] = ""; $db_pass = $_SESSION['db_pass']; $_SESSION['db_name'] = "kittens1351"; $db_name = $_SESSION['db_name']; $_SESSION['url'] = "localhost"; $url = $_SESSION['url']; $mysqli = mysqli_connect($db_server, $db_user, $db_pass, $db_name);//error line ?> Quote Link to comment https://forums.phpfreaks.com/topic/162654-solved-connection-problems/ Share on other sites More sharing options...
pkedpker Posted June 17, 2009 Share Posted June 17, 2009 Code: <?php $db_server = "localhost"; $_SESSION['db_user'] = "root"; $db_user = $_SESSION['db_user']; $_SESSION['db_pass'] = ""; $db_pass = $_SESSION['db_pass']; $_SESSION['db_name'] = "kittens1351"; $db_name = $_SESSION['db_name']; $_SESSION['url'] = "localhost"; $url = $_SESSION['url']; $mysqli = mysqli_connect($db_server, $db_user, $db_pass, $db_name);//error line ?> u should store the server/user/pass/db name in a config file not in sessions sessions is for each user.. (unless your making a login script for different databases..) you need session_start(); on top of file Quote Link to comment https://forums.phpfreaks.com/topic/162654-solved-connection-problems/#findComment-858440 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.