<?php
$empno=$_GET['id'];
//database connect
$db=mysqli_connect("localhost","root","","mycompanyhr");
// database connection
if ($db==false) {
echo "Connect failed: ". mysqli_connect_error($db);
exit();
}
else {
echo "Connection successful";
}
$sql1="select * from employee where EMPNO='$empno' ";
$rs1=mysqli_query($db,$sql1);
//fetch all data
$record=mysqli_fetch_array($rs1);
$fname=$record['FIRSTNAME'];
$lname=$record['LASTNAME'];
$dept=$record['WORKDEPT'];
$phone=$record['PHONENO'];
?>
Update record
<form name='forminsert' method='get' action=''>
Employee no
<input name='txtempno' type='text' maxlength=6
value='<?php echo $empno;?>' > <br>
Firstname
<input name='txtfname' type='text'
value='<?php echo $fname;?>' > <br>
Lastname
<input name='txtlname' type='text'
value='<?php echo $lname;?>' > <br>
Department
<input name='txtdept' type='text'
value='<?php echo $dept;?>' > <br>
Extension
<input name='txtphone' type='text'
value='<?php echo $phone;?>' > <br>
<input name='submit' type='submit' value='Save'> <br>
</form>
<?php
//extract all info from the form
$empno=$_GET['txtempno'];
$fname=$_GET['txtfname'];
$lname=$_GET['txtlname'];
$dept=$_GET['txtdept'];
$phone=$_GET['txtphone'];
//develop the SQL command
if($empno!=''){
$sql="update employee
set FIRSTNAME='$fname', LASTNAME='$lname',
WORKDEPT='$dept', PHONENO='$phone'
where EMPNO='$empno' ";
//execute the SQL command
$rs=mysqli_query($db,$sql);
//check the execution status
if($rs==false){
echo "Record cannot be saved!<br>";
echo "SQL Error : ".mysqli_error($db);
}
else{
echo "<br>Record for $fname update!<br>";
echo "<a href='listing-edit.php'>
List records</a><br>";
}
}//end NULL
?>
Or you could download here for the Malay proverbs app – https://play.google.com/store/apps/details?id=net.kerul.peribahasa English proverbs and the Malay pair Corpus Reference: Amir Muslim, 2009. Peribahasa dan ungkapan Inggeris-Melayu. DBP, Kuala Lumpur http://books.google.com.my/books/about/Peribahasa_dan_ungkapan_Inggeris_Melayu.html?id=bgwwQwAACAAJ CTRL+F to search Proverbs in English Definition in English Similar Malay Proverbs Definition in Malay 1 Where there is a country, there are people. A country must have people. Ada air adalah ikan. Ada negeri adalah rakyatnya. 2 Dry bread at home is better than roast meat home's the best hujan emas di negeri orang,hujan batu di negeri sendiri Betapa baik pun tempat orang, baik lagi tempat sendiri. 3 There's no accounting for tastes We can't assume that every people have a same feel Kepala sama hitam hati lain-lain. Dalam kehidupan ini, setiap insan berbeza cara, kesukaan, perangai, tabia
Comments
Post a Comment