how to fetch data from url in php
Here is an example of code to fetch data from a database and display it on a web page:
Step 1: pass the id when click ‘ EDIT ‘ action
![](http://phpfortech.com/blog/wp-content/uploads/2023/02/pass-id.jpg)
Step 2 : get the data $id = $GET[‘id’]; and write the query
![](http://phpfortech.com/blog/wp-content/uploads/2023/02/get_data_query.jpg)
Step 3 : fetch data run while loop
![](http://phpfortech.com/blog/wp-content/uploads/2023/02/while_loop_start.jpg)
Step 4: now write the code for echo get data here
<?php echo $row[“name”]?>
![](http://phpfortech.com/blog/wp-content/uploads/2023/02/get_data_in_field.jpg)
Step 5: last is end the while loop after form
![](http://phpfortech.com/blog/wp-content/uploads/2023/02/while_loop_end.jpg)