-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgetComments.php
32 lines (26 loc) · 878 Bytes
/
getComments.php
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
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "isdm";
$con = mysqli_connect($servername, $username, $password, $dbname);
$q = $_REQUEST["q"];
$query = "select CName, Comment from comment natural join customer where PID = $q";
$result = mysqli_query($con, $query);
$rows = mysqli_num_rows($result);
echo "</br><center><table><tr> <th>User</th> <th>Comment</th></tr>";
for ($j = 0 ; $j < $rows ; ++$j) {
$row = mysqli_fetch_row($result);
echo "<tr>";
echo "<td>$row[0]</td>";
echo "<td>$row[1]</td>";
echo "</tr>";
}
echo "</table>";
echo "<textarea name=\"txtAr\" rows=3 cols=40></textarea></br>";
echo "<center><input type=\"submit\" value = \"Add Comment\" name = \"addComm\" onclick=\"addComment($q,'txtAr')\">";
echo "<span id=\"abcd\"></span></center>";
?>
<body>
<span id="abcd"></span></center>
</body>