<form name='search' method='get' action=''>
Insert the firstname
<input type='text' name='txtname'>
<input type='submit' value='search name'>
</form>
<?php
//database connect
$db=mysqli_connect("localhost","root","","mycompanyhr");
//checking database connection
if ($db==false) {
echo "Connect failed: ". mysqli_connect_error($db);
exit();
}
else {
echo "Connection successful";
}
$n=$_GET['txtname'];
$sql="select EMPNO, FIRSTNAME, LASTNAME, WORKDEPT,
PHONENO
from employee
where FIRSTNAME like '%$n%' ";
$rs=mysqli_query($db,$sql);
if($rs==false){
echo ("Query cannot be executed!<br>");
echo ("SQL Error : ".mysqli_error($db));
}
else{
echo "<table border=1>";
echo "<tr>";
echo "<td></td>";
echo "<td></td>";
echo "<td>Employee no</td>";
echo "<td>First name</td>";
echo "<td>Last name</td>";
echo "<td>Department</td>";
echo "<td>Phone ext</td>";
echo "</tr>";
while($rekod=mysqli_fetch_array($rs)){
echo "<tr>";
$empno=$rekod['EMPNO'];
echo "<td> <a href='delete.php?id=$empno'>
delete </a> </td>";
echo "<td> <a href='update.php?id=$empno'>
update </a> </td>";
echo "<td>".$empno."</td>";
echo "<td>".$rekod['FIRSTNAME']."</td>";
echo "<td>".$rekod['LASTNAME']."</td>";
echo "<td>".$rekod['WORKDEPT']."</td>";
echo "<td>".$rekod['PHONENO']."</td>";
echo "</tr>";
}//end while
}//end null
echo "</table>";
?>
Listing records to be update (listing-edit.php)
Subscribe to:
Post Comments (Atom)
Popular Posts
-
Or you could download here for the Malay proverbs app – https://play.google.com/store/apps/details?id=net.kerul.peribahasa English prove...
-
This is one of my Android phone, bought specially to test our m-DictionaryApp project . I bought it on the last September 2010 (sponsored by...
-
I’ve been trying to release this tutorial quite a while. At last after a long hard effort. Since HttpClient is not supported any more in...
-
HTML without framework is dull. Doing hard-coded CSS and JS are quite difficult with no promising result on cross platform compatibility....
-
This code is a simple code for Android application. It has two textboxes to receive two numbers (decimal), list of mathematical operations w...
-
This tutorial is tested on Honeycomb 3.0 environment. In order to be used it in the lower level of Android API, I believe you could just cha...

No comments:
Post a Comment