Announcement

Collapse
No announcement yet.

Ich finde den Fehler nicht im Select

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Ich finde den Fehler nicht im Select

    Währe nett wenn mir jemand Helfen könnte, habe das select mit Hilfe der Docu zusammengebaut, aber in meinen Augen müsste alles richtig sein ;-(

    MySql version : 5.0.18

    1054 - Unknown column 'p.manufacturers_id' in 'on clause'

    select distinct
    p.products_id,
    p.products_fsk18,
    pd.products_name,
    pd.products_short_description,
    p.products_image,
    p.products_price,
    p.products_vpe,
    p.products_vpe_status,
    p.products_vpe_value,
    p.products_tax_class_id,
    p.products_date_added,
    m.manufacturers_name
    from products p,
    categories c,
    products_to_categories p2c
    left join manufacturers m
    on p.manufacturers_id = m.manufacturers_id
    left join products_description pd
    on p.products_id = pd.products_id
    and pd.language_id = '2'
    where c.categories_status=1
    and p.products_id = p2c.products_id
    and c.categories_id = p2c.categories_id
    and products_status = '1'
    and p.group_permission_1=1
    and p.products_date_added > '2008.03.12'
    order
    by
    p.products_date_added DESC

  • #2
    Prüfe, ob es die Spalte manufacturers_id in der Tabelle Produkts wirklich so geschrieben gibt. Vielleicht hast Du Dich verschrieben.

    Gruß
    docendo discimus

    Comment


    • #3
      Das habe ich alles durch, die Spalte heisst so und ist da

      Comment


      • #4
        Hi,

        dann versuche mal, Dich lansam ranzutasten. Specke den select ab. Lies erstmal nur von products ( vielleicht nur einen Wert) und manufacturers mit dem left Join. Und wenn das klappt, füge den Rest sukzessive hinzu.
        docendo discimus

        Comment


        • #5
          Hallo Andi,

          kann es vielleicht damit zusammenhängen das du beim SELECT die Spalte p.manufacturers_id nicht explizit mit angegeben hast?

          Gruß Silvio

          Comment


          • #6
            Hi,

            Leider nicht, das habe ich auch schon durch.

            Comment


            • #7
              Hi Andi und Silvio,

              die Spalte p.manufacturers_id muss man auch nicht explizit angeben, sie sollte nur da sein.
              Eine andere Frage warum hast Du bei and products_status = '1'
              die Tabelle nicht mit angegeben? Ich glaube zwar nicht, dass das die Ursache ist, aber es ist auf jeden Fall sauberer. Wie ich bereits geschrieben habe, ein schrittweiser Aufbau und Test des Selects führt wahrscheinlich am schnellsten zum Erfolg.


              Gruß
              docendo discimus

              Comment

              Working...
              X