• Register
Welcome to Techno Smarter QA, Questions, Answers Community
Welcome to Techno Smarter Q&A, where you can ask questions and receive answers from other members of the community. Ask the tech & programming Question that you want. Guests Posting are allowed.
+2 votes
28 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 (160 points) 4
Can you edit your description to add database structure in MDB? Kindly add your database image in the description .

2 Answers

+2 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 (7.1k points) 4 21 46
+1 vote

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 (5.1k points) 4 16 45
...