Ok i have urls that look like this:
http://url.com/product.php?id=1
http://url.com/product.php?id=2
http://url.com/product.php?id=3
I want to use the "id" variable from the URL to select that row from the SQL DB...
Right now the only way i know how to do this is by making a new variable for every single option:
if($_GET["id"]=="1")
{ $bbb = '1'; }
if($_GET["id"]=="2")
{ $bbb = '2'; }
if($_GET["id"]=="3")
{ $bbb = '3'; }
Then use the new variable i made to select the row from the DB:
mysql_select_db("vita1_vita");
$query = "select * from vitamins where id = '$bbb'";
Is there any way i can somehow transfer the number directly from the url into the " where id = ""; " so i don't have to list every option?
Thanks for any help!
EDIT:
Wow.. after i thought i tried everything it was really simple 🙂
$bbb = ($_GET["id"]);