# \[MySQL + PHP\] How use url string id# to select row from DB?

**URL:** <https://forum.kirupa.com/t/mysql-php-how-use-url-string-id-to-select-row-from-db/127827>\
**Category:** Uncategorized\
**Created:** [November 6, 2004, 9:48pm UTC](https://forum.kirupa.com/t/mysql-php-how-use-url-string-id-to-select-row-from-db/127827 "2004-11-06T21:48:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![polishbroadcast](https://avatars.discourse-cdn.com/v4/letter/p/82dd89/32.png) [@polishbroadcast](https://forum.kirupa.com/u/polishbroadcast)\
**Post date:** [November 6, 2004, 9:48pm UTC](https://forum.kirupa.com/t/mysql-php-how-use-url-string-id-to-select-row-from-db/127827/1 "2004-11-06T21:48:32Z")

</div>

Hi. I’m very new to this so please speak slowly and loudly. I have each row in my DB labeled with an id #. There is a column called “id” and a single digit denoting that row. How can i pull the string from the url

```auto
http://url.com/page.php?id=2

```

and have it echo the content only from that row with the id of “2”?

Right now i have a database set up with one table for each section of the site I’m building. Each sub-section has an id# associated with it. So for example i have the first section “Company” and sections within “Company”: “Overview, Management, etc.”

“Company” is the first table and the subsections have the id#'s. ie. Overview id = 1, Management id = 2, etc. Ultimately i want to just have a url like:

```auto
http://url.com/company.php?id=2

```

which will echo the content for the Management row. I have everything working great, the DB, i know how to get the info from the DB to be on the PHP page in the browser and all that good stuff.

I know this is done all the time but would love to see an example that i can repurpose. I didn’t really know what to search for on the web to find a tutorial.

Thanks!
