I have two tables with 1 identical data column for comparison.
One table "species" is a wide list of species and each data row has one unique id called "suid" add. to its primary id as usual. The second table "printpipe" is a shopping cart for printouts and each row has the suid from the species and a unique personal id from the user "guid".
Now I want to get all rows from "species" having empty field "stockimg" and not "noimage.png" in field "stockimg" AND do not exist in table "printpipe" with same suid AND having memb_guid identical to users guid I have as variable $guid
My query I tried is:
$get_allspecies = $mysqli->query("SELECT * FROM species WHERE stockimg <> 'noimage.png' AND stockimg <> '' AND NOT EXISTS (SELECT * FROM printpipe WHERE printpipe.suid = species.suid AND memb_guid = '$guid') ORDER BY name_sc, name_de");
But it doesn't work. What am I doing wrong?
