Welcome to my another PHP and MYSQL tutorial. In the previous I've discussed about the data insertion into database by using PHP and MYSQL. So i did successfully in the previous video.
In this video tutorial I'll discuss How to fetch data from the database called as data fetching. It's really a simple thing to access your data which is in database. You just have to do a little work for this. For fetching data you have follow some steps.
How to Fetch Data from Database
Step 1:
Make a connection with your database which i did in the previous blog.
Step 2:
If you wanna fetching a values in "form" or in a table so just have to create a form, table or whatever you want in HTML. I've created a table where I'll show you how to fetch data in table form.
Step 3:
Write a query SELECT * FROM table_Name;
Step 4:
Create a Loop for fetching all the data on a single click.
Step 5:
Create variables for the sake of storing a different values from the combined values in the loop variable like:
//while loop to fetch all the values from the database and stored in the variable named "row".
while($row = mysql_fetch_array(mysql_query($conn,$query))){
$name = $row['username']; //$name will save all the username values from the loop variable 'row'.
$pass = $row['password']; //$pass will save the password values from the loop variable 'row'.
}
Now watch the video for better understanding.
More articles
- Pentest Tools Tcp Port Scanner
- Pentest Tools Windows
- Hack Tools For Games
- Hak5 Tools
- Pentest Tools Review
- Hack Tools 2019
- New Hacker Tools
- Hacking Tools 2020
- Pentest Tools Website Vulnerability
- Pentest Tools Github
- Hack Tools For Games
- Underground Hacker Sites
- Tools For Hacker
- How To Hack
- Pentest Automation Tools
- Pentest Tools Subdomain
- Pentest Tools Url Fuzzer
- Hack Rom Tools
- Pentest Tools Online
- Pentest Tools
- Hacker Tools Github