Peter Boldsen Peter Boldsen - 1 year ago 117
MySQL Question

Making a 2 tables join in phpmyadmin

Been trying to make a join between 2 of my tables, tried all kind of inputs but all seem wrong, could anyone help me?

Both tables got "ID" in common.

SELECT dmb.Antal ben
, dmb.ID
, dmb.Navn
, sadb.ID
, sadb.Pris
FROM dmb
INNER
JOIN sadb
ON sadb.ID = dmb.ID
WHERE dyr med ben.ID ID=1

Answer Source

My guess is that you are incorporating spaces in your table and column names. This is a seriously bad idea. Also, you seem to be uncertain what the name of your tables are. With lots of assumptions, a valid query may look like this:

SELECT dmb.`Antal ben`
     , dmb.ID
     , dmb.Navn
     , sadb.ID
     , sadb.Pris
  FROM `dyr med ben` dmb
 INNER
  JOIN sadb
    ON sadb.ID = dmb.ID
 WHERE dmb.ID = 1

Also, aren't vertebrates 'virveldyr' ??

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download