Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if(isset($_POST['update'])) {
- $dsn = 'mysql:host=localhost;dbname=ops';
- $username = 'ttt';
- $password = 'abc123';
- // Connect To MySQL Database
- $con = new PDO($dsn,$username,$password);
- if(! $con ) {
- die('Could not connect: ' . mysql_error());
- }
- //Update Data
- $cotwid= $_POST['cotwid'];
- $empid = $_POST['empid'];
- $evaldate = $_POST['evaldate'];
- $status = $_POST['status'];
- $marksgain = $_POST['marksgain'];
- $arreason= $_POST['arreason'];
- $sql = "UPDATE cotw SET status = $status, evaldate=$evaldate, marksgain=$marksgain, arreason=$arreason, evaluatedby=$userid WHERE cotwid= $cotwid" ;
- mysql_select_db('ops');
- $retval = mysql_query( $sql, $con );
- if(! $retval ) {
- die('Could not update data: ' . mysql_error());
- }
- echo "Updated data successfully";
- echo "<script>window.open('pcotw.php','_self')</script>";
- mysql_close($conn);
- }
- else
- {
- echo "Testing update";
- }
- ?>
Add Comment
Please, Sign In to add comment