I have two queries. The first query gets a single piece of data from the table `users` then the second query uses the data from the first query to grab new information. I believe the JOIN mechanism is used to combined these two queries into a single query, but I can't figure out the syntax for the life of me. If someone could give me a hand I'd appreciate it. Thanks.
$q = "SELECT * FROM users WHERE username='$username'";
$result = mysql_query($q) or die ('Something is wrong with query: ' . $q . '<br>'. mysql_error());
$row = mysql_fetch_assoc($result);
$pcid = $row['pcid'];
$q = "SELECT * FROM bhd_stats WHERE pcid='$pcid'";
$result = mysql_query($q) or die ('Something is wrong with query: ' . $q . '<br>'. mysql_error());
$row = mysql_fetch_assoc($result);
//echo other stuff