-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsub_sep.php
More file actions
61 lines (53 loc) · 1.57 KB
/
sub_sep.php
File metadata and controls
61 lines (53 loc) · 1.57 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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
$dbusername="root";
$dbpassword="";
$dbhost="localhost";
$dbname="result";
$con= new mysqli($dbhost,$dbusername,$dbpassword,$dbname);
if(mysqli_connect_error())
{
die('Connection error ('.mysqli_connect_errno().')'.mysqli_connect_error());
}
else
{
$table0="data3";
$table1="mech";
$table2="civil";
$table3="ec";
$table4="eee";
$table5="cs";
$reg="Reg";
$qu="select * from $table1";
$q=mysqli_query($con,$qu);
while ($a=mysqli_fetch_array($q,MYSQLI_BOTH)) {
$k=$a['Sub1'];
$len=strlen($k);
if($len>9){
echo "<tr><td> ".substr($k, 0,5);
echo " :Absent </td></tr>";
}
elseif(strpos($k, "FE"))
{
echo "<tr><td> ".substr($k, 0,5);
// $len=strlen($k);
echo " : ".substr($k, -3,-1);
echo "</td></tr>";
}
elseif(strpos($k, '+'))
{
echo "<tr><td>".substr($k, 0,5);
// $len=strlen($k);
echo " : ".substr($k, -3,-1);
echo "</td></tr>";
}
else{
echo " <tr><td> ".substr($k, 0,5);
echo " : ".substr($k,-2,-1);echo "</td></tr>";
}
}
// }
// }
// }
}
mysqli_close($con);
?>