$servername = "localhost"; $username = "root"; $password = ""; $dbname = "jjmtmain";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
} else {
echo "Connected to database.";
}
/* In further operations you can use the $conn object for the database connection.
For eg.$q = mysqli_query($conn, "select * from user where email='$userid'");
$r = mysqli_fetch_array($q);
echo $name = $r['name'];
*/
Comments
Post a Comment