-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlistx.php
115 lines (78 loc) · 2.01 KB
/
listx.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
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<html>
<head>
<title>RECORDS</title>
</head>
<body>
<?php
$rec_limits =5;
$conn = mysql_connect('localhost','root','root','erp');
if(! $conn ) {
die('Could not connect: ' . mysql_error());
}
$sql = 'SELECT count(id) FROM slogin';
mysql_select_db('erp');
$retval = mysql_query($sql,$conn);
if(! $retval ) {
die('Could not get data: ' . mysql_error());
}
$row = mysql_fetch_array($retval, MYSQL_NUM );
$rec_count = $row[0];
if( isset($_GET{'page'} ) ) {
$page = $_GET{'page'} + 1;
$offset = $rec_limit * $page ;
}else {
$page = 0;
$offset = 0;
}
$left_rec = $rec_count - ($page * $rec_limit);
$sql = "SELECT name, email, mobile ".
"FROM login ".
"LIMIT $offset, $rec_limit";
$retval = mysql_query( $sql, $conn );
if(! $retval ) {
die('Could not get data: ' . mysql_error());
}
echo
"<h2>Registered Student </h2>";
echo
"<table border='3'>
<tr>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
</tr>";
while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) {
echo
"<tr>
<td>{$row['name']}</td>
<td>{$row['email']}</td>
<td>{$row['mobile']}</td>
</tr>\n";
}
echo "</table>";
/*$sql = 'SELECT pname, email,mobile FROM flogin';
mysql_select_db('login_form');
$retval = mysql_query($sql,$conn);
if(! $retval ) {
die('Could not get data: ' . mysql_error());
}
echo "<h2>Faculty Info</h2>";
echo" <table border='3'>
<tr>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
</tr>" ;
while($row = mysql_fetch_array($retval, MYSQL_ASSOC)) {
echo
"<tr>
<td>{$row['pname']}</td>
<td>{$row['email']}</td>
<td>{$row['mobile']}</td>
</tr>\n";
}
echo "</table>";*/
mysql_close($conn);
?>
</body>
</html>