Ver original$resultado=mysql_query("select * from tabla1,tabla2 where iddocumento.tabla1=iddocumento.tabla2");