Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
anantjain6 authored Jan 17, 2018
1 parent bc567b6 commit 4a4ba4e
Show file tree
Hide file tree
Showing 64 changed files with 23,783 additions and 21 deletions.
22 changes: 14 additions & 8 deletions config.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,22 @@
$host = "localhost";
$username = "root";
$password = "";
$dbname = "";
$dbname = "mcq";

$connection = mysql_connect($host,$username,$password);
// Connecting to database
$connection = mysqli_connect($host,$username,$password,$dbname);
mysqli_set_charset($connection,"utf8");

if (!$connection)
{
die('Could not connect: ' . mysql_error());
function mysqli_result($res,$row=0,$col=0){
$numrows = mysqli_num_rows($res);
if ($numrows && $row <= ($numrows-1) && $row >=0){
mysqli_data_seek($res,$row);
$resrow = (is_numeric($col)) ? mysqli_fetch_row($res) : mysqli_fetch_assoc($res);
if (isset($resrow[$col])){
return $resrow[$col];
}
}
return false;
}

mysql_select_db($dbname) or die(mysql_error());
mysql_query("SET NAMES utf8");

?>
Loading

0 comments on commit 4a4ba4e

Please sign in to comment.