$id=$_GET["id"];
$query= "
SELECT
blomster_produkter.blomster_produkt_id,
blomster_produkter.blomster_produkt_navn,
blomster_produkter.blomster_produkt_pris
FROM
blomster_produkter
INNER JOIN blomster_produkter ON
blomster_produkter.FK_blomster_produkt_id=blomster_produkter.blomster_produkt_navn
blomster_produkter.FK_blomster_produkt_id=blomster_produkter.blomster_produkt_pris
blomster_produkter.FK_blomster_produkt_id=blomster_produkter.blomster_produkt_id
WHERE FK_blomster_kategori_id=$id";
Why is this throwing me an mysql error 1066?
(also sorry if i am missing some important stuff, this is the first question i am asking on stackoverflow)
Error 1066 is "Not Unique table/alias"
this is because you are join a table with itself without making aliases, you must do aliases like:
0.1 seconds of googling: "mysql error 1066" - not unique table name/alias
you cannot join a table to itself, or re-use the same table name in a join, without using an alias:
and then changing table references as necessary in your join conditions.
As well, note that you are wide open to sql injection attacks. Enjoy having your server pwn3d.