Hi, I have a problem. When im wrting the code in php I put it like this:
<table>
....
<?php
$sql = "SELECT wines.id, regions.name AS region, wines.name, color, year, price FROM wines, regions WHERE regions.id = wines.region_id ORDER BY year"
$query = mysql_query($sql);
In the browser It appears everything right like the table is with the : Id, name, color, year, price and regions. But Can you tell me How can I choose a Particular color in the $sql part of the code so that I am able to display only that color items in the table?
I already tried to set it "..., color=1,..." but it doesn't work very well.
The color are in type "enum('Red','White','Rose') So 1, 2 and 3.
03-13-2013, 08:22 PM
NogDog
You mean something like this?
Code:
. . . WHERE regions.id = wines.region_id AND color = 'red' . . .