MySQL queries allow you to SELECT just some of the data using WHERE within the query:
$cdquery="SELECT * FROM firsttable WHERE cdArtist='Kings Of Leon'";
For this to work you need one CD in your table with a matching artist. If you imported the data you will have that. If not add one. Put the code into the existing page (firstmysqlpage.php) to replace the existing line which starts $cdquery=.
Save, upload and try the page. It should return one result only.
Note that the SQL special words (SELECT, FROM, WHERE) are put in capitals to make them stand out.
AND and OR
It is also possible to use more than one check in the WHERE with a line something like this:
$cdquery="SELECT * FROM firsttable WHERE cdArtist='Kings Of Leon' AND cdTitle='Youth And Young Manhood'";
OR can be used as well.
Replace the $cdquery line in firstmysqlpage.php with both of the above. Try them. Fiddle by editing the queries and checking the results. You could do a WHERE based on price. You can use < or > as well as = when you are dealing with numbers. You could also try != (not equal to).
PHP variables in queries
You will rarely know what needs to be extracted but instead will probably want to find database data in response to user input. For example they might choose to buy a product and you then need to look up the price for that product:
$cdquery="SELECT price FROM products WHERE productid='$productid'";
The product ID variable might have come from a form via $_POST.



