I'm building my php application that relates with a MySQL database. I have some problems doing specific queries since i'm not used doing complex ones. I want to find out how to build query string to do this: Based on "cad_proc" "sigla" i want to get "estado" from "juizo" to make sure that i'm looking for "cad_proc" that have "MG" on it.
Table1: cad_proc
id - sigla - ...
01 - MG105 - ...
03 - M123 - ...
Table2: juizo
sigla - estado -...
MG105 - MG
M123 - MG
My query so far is:
SELECT * FROM cad_processo WHERE sigla like '$UF';
Where $UF
is an input from user.