#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Posts
    3
    Rep 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 order to get the three versions when asking for "red"?

    I have tried the following:

    if ($colour == "red") {$colour2 = "rot";}

    if ($colour == "red") {$colour3 = "rouge";}

    $sql = "select * from table where colour in('$colour','$colour2','$colour3')";

    Is this coding correct, or are there other possibilities to get the results in the most performant way?

    Thank you
    Niko

  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 1999
    Location
    Helden,Limburg,The Netherlands
    Posts
    33
    Rep Power
    15
    Hi,

    Just take the total value from the column which is probably a comma-delimited string and put it in an array, in PHP this can be done with the implode-function (or explode, I always confuse those two). Next you can base the language for your info on the index-number of the array.

    Greetz,
    Ramon.

    ------------------
    Ramon Litjens
    Boradoli Web Design
    (www.boradoli.nl)

IMN logo majestic logo threadwatch logo seochat tools logo