Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host="localhost"; //replace with database hostname
- $username="username"; //replace with database username
- $password="attendance"; //replace with database password
- $db_name="db_name"; //replace with database name
- $con=mysql_connect("$host", "$username", "$password") or die ("cannot connect");
- mysql_select_db("$db_name") or die ("cannot select DB");
- $matric = $_POST['matric'];
- $mac = $_POST['mac'];
- $sql = "update students set `mac` = '$mac' WHERE `matric` = $matric";
- if(mysql_query($sql)){
- echo 'success';
- }
- else{
- echo 'failure';
- }
- mysql_close($con);
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement