Php selection

Discussion in 'PHP' started by Alice24, Feb 28, 2011.

  1. #1
    [​IMG]

    i want to select from "nume" where "gen" is actiune but i have a little problem
    it select only the second entry where "actiune" is the only word...

    i have tryed this code

    <?php
    require_once('config.php');
    
    $cerereSQL = 'SELECT nume FROM test WHERE gen="actiune" ';
    $rezultat = mysql_query($cerereSQL);
    
       while($rand = mysql_fetch_array($rezultat)) {
        
    
        echo '
     <b>Nume:</b> '.$rand['nume'].' <br>
     
     '  ; 
      
    
    }
    ?>
    PHP:
    i have tried to entry in the table like this
    
    actiune aventura comedie
    actiune,aventura,comedie
    actiune/aventura/comedie
    
    
    PHP:
    but no result ...
     
    Alice24, Feb 28, 2011 IP
  2. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #2
    try this :
    SELECT nume FROM test WHERE gen LIKE "%actiune%"
     
    tvoodoo, Feb 28, 2011 IP
  3. Alice24

    Alice24 Greenhorn

    Messages:
    59
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    16
    #3
    Thank you @tvoodoo
     
    Alice24, Mar 1, 2011 IP
  4. tvoodoo

    tvoodoo Active Member

    Messages:
    239
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    53
    #4
    Your welcome !
     
    tvoodoo, Mar 1, 2011 IP