combining 2 fields in a single mysql select query
Posted 28 September 2006 - 11:46 PM
i want to combine 2 fields in a single select query
fields. pageheader name
values. abcd <div id="d"></div>
i want to merge/combine the pageheader and name in a single select query so that it can retrieve the pageheader with some styles which i have stored in another table
Posted 29 September 2006 - 12:57 AM
'SELECT field_one, field_two FROM tablename '
if they're in two separate tables
'SELECT tablename_one.field_one, tablename_two.field_two FROM tablename_one, tablename_two '
and if they're somehow related use the WHERE clause
Posted 29 September 2006 - 10:06 AM
SELECT CONCAT(tbl1.pageheader,' ',tbl2.name) FROM tbl1 JEFT JOIN tbl2 ON tbl1.pageid=table2.pageid WHERE tbl1.pageid=1;
CONCAT will join the strings to make 1 string...
LEFT JOIN to get match the rows in the tables??
hope thats not completely useless to you!
Posted 29 September 2006 - 08:24 PM
i want to store css styles(simple box) in one table and in another table divs as one field and content as another field.so that when i combine these two tables in a select query i can get a some text in that box.how to do it.your help will be appreciated.i had stored styles and divs and content but when i retrieve it the content(text) is displaying outside of styles.i want to display the text in box
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users