
April 3rd, 2000, 06:30 AM
|
|
Junior Member
|
|
Join Date: Mar 2000
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
|
Hello,
my database table has a column "Colour". There you can find different linguistic versions (english, french, german) of the same colour.
Example: red (german: rot; french: rouge)
How do I have to write my query string in MYSQL/PHP in order to get the three versions when asking for "red"?
I have tried the following:
-----------------------------------------
if ($colour == "") {$colour = '%';}
if ($colour == "red") {$colour2 = "rot";}
if ($colour == "red") {$colour3 = "rouge";}
$sql = "select * from table where (colour like '$colour' or colour like '$colour2' or colour like '$colour3')";
-------------------------------------------
I always get the answer " No data found..", but there is some data that should be found.
Please, tell me how to modify this coding to get it run correctly.
Thank you
Niko
|