Jump to content

jhuna122

New Members
  • Posts

    1
  • Joined

  • Last visited

jhuna122's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Whenever i search in my search.php it doesn't show any result, it remains blank without any search from my database table. I am really in a big trouble as my mind getting hang. Please help me to correct or need to solve whatever problem is and thanks in advance Here is the search.php page code. <?php $output = NULL; if(isset($_POST['submit'])){ $mysqli = NEW MySQLi("localhost","root","","inventory"); $search = $mysqli->real_escape_string($_POST['search']); $resultSet = $mysqli->query("SELECT * FROM invlist WHERE asset_num = '$search'"); if($resultSet->num_rows > 0){ while($rows = $resultSet->fetch_assoc()) { $sn = $rows['sn']; $asset_num = $rows['asset_num']; $output = "Serial Number: $sn<br />Asset Number: $asset_num"; } }else{ $output = "No results"; } } ?> <form method="POST" action="search.php"> <input type="TEXT" name="search" /> <input type="SUBMIT" name="submit" value="Search" /> </form>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.