Skip to content

Commit

Permalink
Create getPermission.php
Browse files Browse the repository at this point in the history
  • Loading branch information
nihr43 authored Nov 11, 2016
1 parent 3102083 commit c527a7a
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions DML/getPermission.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "db";
$input = "test";
$id= "";

// Create connection
$conn = new mysqli($servername, $username, "", $dbname);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}

// prepare and bind
$stmt = $conn->prepare("select permission_name FROM permission WHERE id=?");
$stmt->bind_param("i", $usertypeid);

//execute
$stmt->execute();
$stmt->bind_result($id);
$stmt->store_result();
$stmt->fetch();
echo $id;
$stmt->close();
$conn->close();
?>

0 comments on commit c527a7a

Please sign in to comment.