# Superglobals in MySQL query in PHP

**URL:** <https://forum.kirupa.com/t/superglobals-in-mysql-query-in-php/114202>\
**Category:** Uncategorized\
**Created:** [June 25, 2004, 8:14pm UTC](https://forum.kirupa.com/t/superglobals-in-mysql-query-in-php/114202 "2004-06-25T20:14:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bunjiquo](https://avatars.discourse-cdn.com/v4/letter/b/5daacb/32.png) [@bunjiquo](https://forum.kirupa.com/u/bunjiquo)\
**Post date:** [June 25, 2004, 8:14pm UTC](https://forum.kirupa.com/t/superglobals-in-mysql-query-in-php/114202/1 "2004-06-25T20:14:25Z")

</div>

I am trying to write a page that will select info from a database dependent on one variable which will be sent using $\_GET[‘car’]

I am unsure about how to work the $\_GET[‘car’] into my SQL query line.

At the moment i have:-

```php
$result = mysql_query("SELECT * FROM products WHERE ($_GET['car'])=1");

```

and i would use \*[http://www.address.com/nameofphpfile.php?car=e36coupe](http://www.address.com/nameofphpfile.php?car=e36coupe) \* to send the names of the desired column in the MySQL table.

I can get the page to work fine if i just use something like:-

```php
$result = mysql_query("SELECT * FROM products WHERE e36coupe=1");

```

but id like to be able to use a dropdown menu to select the car model rather than have a seperate php page for each one.

Any help much appreciated

Bunji
