876-967-1526 nlj@nlj.gov.jm
<?PHP $servername = "nljgov2.yourwebhostingmysql.com"; $username = "nljgov2"; $password = "2OJNxtBIqv"; $database = "nlj_manuscripts"; // Create connection $conn = mysqli_connect($servername, $username, $password,$database ); // $conn = mysqli_connect( "nljgov2.yourwebhostingmysql.com", "nljgov2", "2OJNxtBlqv", "nlj_manuscripts" ); // $conn = mysqli_connect("localhost","root","1ns@dmin","nlj_man"); // Check connection if (!$conn) { die("Connection failed: " . mysqli_connect_error()); } if ($_SERVER['REQUEST_METHOD'] == 'POST') { $search = $_POST["search"]; //read text field $searchType = $_POST['searchType']; //read radio button $sql = "SELECT * FROM manuscripts WHERE ".$searchType." LIKE '%".$search."%'"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { while($row = mysqli_fetch_assoc($result)) { echo "<table class=imagetable width='55%' border='1' cellpadding='1' cellspacing='1' align='center'>"; //echo "<tr >"; // echo "<th width=100> Record No: "; // echo $row['num'] . "</th>"; echo "</tr>"; echo "<tr >"; echo "<td width=100>Title</td>"; echo "<td width=400>".$row['title'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>Subjects</td>"; echo "<td width=400>" .$row ['subject'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>Format</td>"; echo "<td width=400>".$row['format'] . "</td>"; echo "</tr>"; echo "<tr>"; echo "<td>Manuscript No</td>"; echo "<td width=400>".$row['man_num'] . "</td>"; echo "</tr>"; echo "<br></br>"; } } else { echo "<h6><center><font face='Lucida Sans' size='4'>No Record(s) Found</font></center></h6>"; } mysqli_close($conn); } ?>