-1
$sele = "SELECT * FROM videos WHERE video_titulo LIKE '%$name%' OR video_chaves LIKE '%$name%'";
$query = "SELECT * FROM usuarios WHERE n_nome LIKE '%$name%' OR n_usuario LIKE '%$name%'";
How to search both tables in one query? Thus:
$search="SELECT * FROM tabela1, tabela2....."
You want to make a
join
in both tables? Or just want to bring all fields of two tables?– Jéf Bueno
make a query and display the two tables in a single search for users and videos
– Gabriel José
What is your database?
– Joao Paulo
I couldn’t understand your comment.
Exibir as duas tabelas
, you meantexibir o resultado das duas tabelas
?– Jéf Bueno
yes in a single consuta
– Gabriel José
$query = $Conn -> query "SELECT * FROM usuarios WHERE n_name LIKE '%$name%' OR n_usuario LIKE '%$name%'";
– Gabriel José
Have you ever tried to do the same in your last example? It would be something like
SELECT t1.*, t2* FROM tabela1 t1, tabela2 t2
. Although I don’t see a clear reason why you want to do this, thisquery
should work.– Jéf Bueno