i try to explain this in proper way, i have two tables in mysql, like: table 1: id1 topic ........ table 2: id2 id1 (this id is the id in table1) .... Now I need get "TOPIC" thru "ID2", Can anyone give me the sql? thanks
I believe this would be correct: mysql_query("SELECT topic FROM table1 WHERE table1.id1=table2.id2");
try this: (SELECT topic FROM table1 WHERE table1.id1=table2.id1) OR, this: select table1.topic from table1 where table1.id1 = table2.id1
i dont think its easy to get understand that without to learn the basic and i would suggest u to go www.php.net and its not a big section of Mysql -> PHP try it. would be the best for u , there are more many options u may want know.
You are getting the unknown table2 error because you aren't using table2 in the query... select table1.topic from table1, table2 where table1.id1 = table2.id1