forked from Puneet2000/Edhub-php-server-script-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathresetname.php
More file actions
33 lines (20 loc) · 677 Bytes
/
resetname.php
File metadata and controls
33 lines (20 loc) · 677 Bytes
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
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "student_information";
// Create connection
$conn = new mysqli($servername, $username, $password, $dbname);
$user_name=$_GET['username'];
$oldname=$_GET['oldname'];
$newname=$_GET['newname'];
$mysql_qry0="select * from student where Username like '$user_name' and Name like '$oldname';";
$mysql_qry="update student set Name='$newname' where Username like '$user_name' and Name like '$oldname';";
$result=$conn->query($mysql_qry0);
if( $result->num_rows>0 )
{ $conn->query($mysql_qry);
echo "Name Changed";
}
else
echo "not changed";
?>