Add exams from exam156 to exam199
This commit is contained in:
28
exam199/index.php
Normal file
28
exam199/index.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
class DatabaseConnect{
|
||||
|
||||
public function __construct($db_host, $db_user, $db_pass)
|
||||
{
|
||||
echo 'Attempting connection...';
|
||||
|
||||
if(!$this->Connect($db_host,$db_user,$db_pass)){
|
||||
echo 'Connection failed';
|
||||
} else {
|
||||
echo 'Connected to '. $db_host;
|
||||
}
|
||||
}
|
||||
|
||||
public function Connect($db_host, $db_user, $db_pass){
|
||||
if(!mysqli_connect($db_host,$db_user,$db_pass)){
|
||||
return false;
|
||||
} else {
|
||||
return true ;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$conn = new DatabaseConnect('localhost','example_user','Kolosnjaj4321!');
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user