-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathview_task.php
More file actions
35 lines (32 loc) · 1.02 KB
/
view_task.php
File metadata and controls
35 lines (32 loc) · 1.02 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<!--
In the name ALLAH the Beneficent , the Merciful.
-->
<?php
include "username.html";
$host_name = "localhost";
$user_name = "root";
$pass_word = "";
$db_name = "my_first_database";
$conn = mysqli_connect($host_name, $user_name, $pass_word, $db_name);
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$myuser = mysqli_real_escape_string($conn , $_POST['user']);
$sql_query = "SELECT task_name , task_description FROM task WHERE assign_to = '$myuser' ";
$ress = mysqli_query($conn, $sql_query);
$rows = mysqli_num_rows($ress);
if ($rows > 0) {
$v = 1;
while ($ans = mysqli_fetch_assoc($ress)) {
echo "task no. " . $v;
echo "<br>";
echo "task name : " . $ans['task_name'];
echo "<br>";
echo "task description : " . $ans['task_description'];
echo "<br>";
$v = $v + 1;
}
}
else {
echo "no task is assigned for " . $myuser;
}
}
?>