help, cant access database. it can't direct me to my database cant use mysql_query for data retrieval. i think it's in my newly created database that the system can't find? but the hosting site gave me no choice to rename my database
db_connect.php
<?php
include_once 'psl-config.php'; // As functions.php is not included
$mysqli = new mysqli(HOST, USER, PASSWORD, DATABASE);
?>
where i call my user and database. psl_config.php
<?php
define("HOST", "localhost"); // The host you want to connect to.
define("USER", "xxx"); // The database username.
define("PASSWORD", "xxx"); // The database password.
define("DATABASE", "xxx"); // The database name.
define("CAN_REGISTER", "any");
define("DEFAULT_ROLE", "member");
define("SECURE", FALSE);
?>
$name = $_SESSION ['username'];
$result = mysql_query(" select score1 from members where username = '$name'");
username is stated correctly. mysql query code line 14 is where the bug is.
<?php
include_once 'includes/db_connect.php';
include_once 'includes/functions.php';
sec_session_start();
if(!isset($_SESSION['username'])){
header("Location: director.php");
}
$name = $_SESSION ['username'];
$result = mysql_query(" select score1 from members where username = '$name'");
?>
i think it's in my newly created database that the system can't find? but the hosting site gave me no choice to rename my database