Looking for help on MYSQL. Basically i have 2 databases on the same host.
1st database has a list of defect types IE… (Plumbing, Electrical , Building) with Unique IDs IE.. 1,2,3,4,5 etc. Second database has the list of all logged defects with multiple fields, one of which is defect types. with the same IDs as above
i need to know how to construct a mysqli query in PHP to do basically the following
if ID from database 1 is equal to ID from Database 2 then print out something
Why have you used two databases for that? It would make way more sense to use two tables in the same database (which also makes using foreign keys easier).
I have a feeling OP is just misusing the the term “database” and actually just has tables.
OP, If your DB was created properly you should not have any defects logged that are not listed in the defect types. Sounds like there is a problem somewhere else that needs to be resolved first. We need more details on what you have going on.