Forums
This topic is locked
Problem of SQL
Posted 26 Aug 2007 00:15:21
1
has voted
26 Aug 2007 00:15:21 awe selistones posted:
hello all,im really crazy right now because i have a big problem to solve. i know how to create search page into 1 table but i dont know how to search into more than 1 table.im using PHP .
here my table have the same column name between table A and table B but i cannot create the SQL.please someone guide and show me. im new for using advance search.
this is my code to search only one table.
SELECT *
FROM awe
WHERE Nama LIKE colname OR Jantina LIKE %colname% OR Umur LIKE %colname% OR Warna LIKE %colname% OR makanan LIKE %colname%
but ..........i dont know how to search more than one table.
thank you.
im already search around this forum about this problem but im not found it how to solve.
Edited by - selistones on 26 Aug 2007 00:17:44
Replies
Replied 29 Aug 2007 04:30:20
29 Aug 2007 04:30:20 Kevin Stillwell replied:
I'll take a guess what you may be looking for.
Currenlty you can:
SELECT *
FROM table1
WHERE something = 'colname'
to select from two tables try:
SELECT *
FROM table1, table2
WHERE something_table1 = something_table2
AND something = 'colname'
Currenlty you can:
SELECT *
FROM table1
WHERE something = 'colname'
to select from two tables try:
SELECT *
FROM table1, table2
WHERE something_table1 = something_table2
AND something = 'colname'