Welcome to Techno Smarter QA, Questions, Answers Community
+3 votes
109 views
Hello, how are you, hope you are doing well.

I have a database in MS Access (.mdb) format, I want to show my database records on the HTML page on the search button.

For example:

If I search the name of the person it should show all record of the search field

* Hope you understand my question.
in PHP by (170 points) 1 5
Can you edit your description to add database structure in MDB? Kindly add your database image in the description .

3 Answers

+3 votes

If you have data in the  MS Access (.mdb) format. You should import this data into MYSQL database formate. You can import the complete database in MYSQL database.

 Upload a CSV(excel) file and import into the database using PHP and MYSQL

You will able to insert your MS Access (.mdb) format into the MYSQL database. 

Now, create an HTML form with one textbox and one button. 

You should understand the MYSQL query. 

Use the input box value as a variable value. 

Select name, mobile , email from table_name where name=$name ; 

Use the query like this and display the value related to the searched name. 

$name = Input box value . 

by (8.9k points) 9 22 61
+2 votes

If you want to display the data on the HTML page using the search button then you should import your MS access data into the MYSQL database. PHP supports to import the MS access data into MYSQL database. If you want to search a name and want to display the data related to the name, you should understand the Where clause. like - 

Select name, email from table_name where name='Jack'; 

The value will be inserted into the input box and will be stored in a variable. You can use the variable in another query to display the related data.

Search data and display it on the HTML page. 

<?php

$databaseHost = '127.0.0.1';//or localhost

$databaseName = 'dbname'; // your db_name

$databaseUsername = 'root'; // root by default for localhost 

$databasePassword = '';  // by defualt empty for localhost

$mysqli = mysqli_connect($databaseHost, $databaseUsername, $databasePassword, $databaseName);

?>

<form action="" method="post">

Enter Name <input type="text" name="name">

<input type="submit" name="submit">

</form>

<?php 

if(isset($_POST['submit']))

{

$name = $_POST['name'];

$stmt = mysqli_query($mysqli,"SELECT email,mobile FROM table_name WHERE name = $name");

  

while($res = mysqli_fetch_array($stmt))

echo $res['emali']; 

echo $res['mobile']; 

}

        }

?> 

The code above will help you understand the searching concept. It's really easy.

You can use another searching reference - 

Display data from MYSQL database table using PHP and AJAX |Search  

by (6.7k points) 7 27 60
0 votes

The search system is like another feature of the website, which increases the value of the website. The search system can be easily created by PHP programming and MySQL database. For this, the PHP function has to be created. Pagination is also required along with the search input box. If a user goes to the website and gets related data from the searched word, then all those data are displayed with the help of the pagination. The search system can be easily created by PHP and MYSQL. Pagination is also required to display data through search.

One day I was also searching on Google about the search system IN PHP. That's when I got the best solution. Which I used on my website along with the search box as well as pagination. This is one of the best solutions for search and pagination in PHP.

Pagination and search box in the blog using PHP and MYSQL

by (4k points) 2 23 52
...