apple
<html>
<head>
<script>
function showTeacher(str) {
var xhttp;
if (str == "") {
document.getElementById("teacherDetails").innerHTML = "";
return;
}
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("teacherDetails").innerHTML = this.responseText;
}
};
xhttp.open("GET", "getTeacherDetails.php?name="+str, true);
xhttp.send();
}
</script>
</head>
<body>
<form>
<select name="teachers" onchange="showTeacher(this.value)">
<option value="">Select a teacher:</option>
<?php
$con = mysqli_connect("localhost","my_user","my_password","my_db");
$sql = "SELECT tname FROM teacher";
$result = mysqli_query($con,$sql);
while ($row = mysqli_fetch_array($result)) {
echo "<option value='" . $row['tname'] ."'>" . $row['tname'] ."</option>";
}
mysqli_close($con);
?>
</select>
</form>
<br>
<div id="teacherDetails"><b>Details will be listed here.</b></div>
</body>
</html>
//PHP Script
<?php
$name = $_REQUEST['name'];
$con = mysqli_connect("localhost","my_user","my_password","my_db");
$sql = "SELECT * FROM teacher WHERE tname = '$name'";
$result = mysqli_query($con,$sql);
while ($row = mysqli_fetch_array($result)) {
echo "<b>Teacher Number:</b> " . $row['tno'] . "<br>";
echo "<b>Name:</b> " . $row['tname'] . "<br>";
echo "<b>Qualification:</b> " . $row['qualification'] . "<br>";
echo "<b>Salary:</b> " . $row['salary'] . "<br>";
}
mysqli_close($con);
?>
-------------------------------------------
Frommlxtend.preprocessingimportTransactionEncoder
Frommlxtend.frequent_patternsimportapriori
TID={1:[“appl
e”,”mango”,
”banana”],
2:[“mango”,
”banana”,
”cabbage”,
3:[“mango”,
”banana”,
”carrots”]
,
”carrots”]
,
4:[“mango”,
”carrots”]
}
#Convertthecategoricalval
Te=TransactionEncoder()
Te_ary=te.fi
t([TI
D[i]forii
uesintonumericformat
nTID]).transform([
Df=pd.DataFrame(te_ary,col
TID[i]forii
umns=te.columns_)
#Applytheapriorial
gorithmwithdifferentmi
nTID])
n_supvalues
Min_sup_values=[0.25,0.5,0.
75]
Formin_supinmin_sup_values:
Frequent_i
temsets=apriori
(df,min_support=mi
Print(“Fr
n_sup,use_colnames=True)
equentitemsetswithmin_sup=”,min_sup)
Print(fr
equent_itemsets)
Print(“\n”