помогите с запросом

Discussion in 'PHP' started by kdk, 3 Jul 2007.

  1. kdk

    kdk Elder - Старейшина

    Joined:
    8 Nov 2006
    Messages:
    112
    Likes Received:
    5
    Reputations:
    -3
    есть
    create table prazdnik(
    id_prazdnik smallint(6) not null AUTO_INCREMENT,
    id_menu smallint(6) not null,
    prazdnik varchar(255) not null,
    primary key(id_prazdnik)
    )Type=Myisam;
    create table mess(
    id_mess smallint(6) not null AUTO_INCREMENT,
    id_prazdnik smallint(6) not null,
    mess varchar(255) not null,
    primary key(id_mess)
    )Type=Myisam;

    мне нужно вывести так,

    select mess.id_mess,mess.mess from prazdnik,mess where prazdnik.id_menu=1 and prazdnik.id_prazdnik=1;

    но выводится почему то вся таблица!
    Зарание спасибо.
     
  2. Ntkiller

    Ntkiller New Member

    Joined:
    30 Jun 2007
    Messages:
    4
    Likes Received:
    4
    Reputations:
    0
    Случайно не http://prazdnik-da.ru/ ?
     
  3. Helios

    Helios Elder - Старейшина

    Joined:
    14 Jan 2007
    Messages:
    414
    Likes Received:
    180
    Reputations:
    103
    Добавь
    Code:
    AND prazdnik.id_mess = mess.id_mess
    
     
  4. kdk

    kdk Elder - Старейшина

    Joined:
    8 Nov 2006
    Messages:
    112
    Likes Received:
    5
    Reputations:
    -3
    не это не.http://prazdnik-da.ru/
    Это просто для себя так пишу!