comment on a column from two tables in a mysql?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
sobha
Forum Commoner
Posts: 56
Joined: Wed Jul 15, 2009 9:08 pm

comment on a column from two tables in a mysql?

Post by sobha »

How to select comment on a column from two tables in a mysql?
I tried this.But it shows error.What is the syntax to be used?
SHOW FULL COLUMNS FROM table1 , table2;
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: comment on a column from two tables in a mysql?

Post by aceconcepts »

Code: Select all

SELECT * FROM table1, table2
sobha
Forum Commoner
Posts: 56
Joined: Wed Jul 15, 2009 9:08 pm

Re: comment on a column from two tables in a mysql?

Post by sobha »

i mean retreiving the comment field from 2 tables

//in case of single table
$sql1 = mysql_query("SHOW FULL COLUMNS FROM members",$link);
while($r1=mysql_fetch_assoc($sql1))
{
$result2=$r1['Comment'];
}

How to write the querry in case of 2 tables?
User avatar
aceconcepts
DevNet Resident
Posts: 1424
Joined: Mon Feb 06, 2006 11:26 am
Location: London

Re: comment on a column from two tables in a mysql?

Post by aceconcepts »

Try,

Code: Select all

SELECT * FROM user_col_comments WHERE table_name = 'your_table_name'
Post Reply