-
Notifications
You must be signed in to change notification settings - Fork 0
/
sortaccfrequencycode.php
33 lines (33 loc) · 1.07 KB
/
sortaccfrequencycode.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
33
<?php
$host="localhost";
$username="root";
$password="";
$dbname="iq_analyser";
$conn = new mysqli($host, $username, $password, $dbname);
if (!$conn) {
die("Connection failed: " . mysqli_connect_error());
}
if(!empty($_POST['topic'])) {
foreach($_POST['topic'] as $check) {
// echo $check;
$sql = "SELECT * FROM topics where topic_id=$check";
$data = mysqli_query($conn,$sql);
while($rec = mysqli_fetch_row($data))
{
echo "Topic: ". "$rec[1]";
echo "<br>";
$sqlquery="SELECT DISTINCT(question),frequency FROM question_details join linking on question_details.qno=linking.qno and linking.topic_id=$rec[0] order by question_details.frequency desc";
$dat=mysqli_query($conn,$sqlquery);
if($sqlquery != false){
while($questiondetails = mysqli_fetch_row($dat))
{
echo "$questiondetails[0]";
echo " $questiondetails[1]";
echo "<br>";
}
}
}
echo "<br>";
}
}
?>