I'm having a little problem. I have 2 tables in my database:
servico
, with id, nome, profissao (plumber, electrician,e tc), data and local.
canalizador
, with id, nome, profissao (only plumber), data and local.
I have this code so that I can get to the "canalizador" table:
mysql_connect($host,$user,$passwd) or die (mysql_error());
mysql_select_db($database);
$query = "SELECT * FROM canalizador WHERE profissao LIKE '$profissao'";
$result = mysql_query($query) or die(mysql_error());
$casaArray = array();
But I need a code where I can search all the tables like the "canalizador" table by just pressing the button of each career(profissao) in the menu. If I do this:
mysql_connect($host,$user,$passwd) or die (mysql_error());
mysql_select_db($database);
$query = "SELECT * FROM canalizador, carpinteiro WHERE profissao LIKE '$profissao'";
$result = mysql_query($query) or die(mysql_error());
$casaArray = array();
I have this error:
Column 'profissao' in where clause is ambiguous