Originally posted by soupman99
I'm using this code
<?php
$id=$_GET['id']; // right here.....
$db = mysql_connect("localhost", "username", "passworkd");
mysql_select_db("databasename",$db);
$result = mysql_query("SELECT * FROM jewelry WHERE catagory=$id",$db);
$myrow = mysql_fetch_array($result);
echo "".$myrow["boldtitle"];
echo "".$myrow["pic"];
echo "".$myrow["nick"];
echo "".$myrow["sele"];
echo "".$myrow["color"];
?>
I have a column in the table named catagory, and I was wanting to pass variables into this page like "view.php?catagory=barbells" and then have the page display all the results that match the word barbells in the catagory column. How do I do this? [/B]
Didn't you already, basically? I added a line to your code, check it out.....
Interestingly enough, I'm curious about these lines:
mysql_select_db("databasename",$db);
$result = mysql_query("SELECT * FROM jewelry WHERE catagory=$id",$db);
Do you need $db at the end of those. PHP != C 😕