       | 1      |
| 1       | 5      |
| 3       | 4      |
| 4       | 1      |
| 4       | 2      |
| 4       | 5      |
| 7       | 2      |
+---------+--------+

// tags
+----+----------+
| id | tag_name |
+----+----------+
| 1  | PHP      |
| 2  | SQL      |
| 3  | MySQL    |
| 4  | CSS      |
| 5  | Java     |
| 6  | HTML     |
| 7  | JQuery   |
+----+----------+

And here is my query:
SELECT id,
       title,
       content
FROM QandA
WHERE id = :id1 OR related = :id2

-- Note: :id1, :id2 are identical

As you see it selects both the question (id = :id2) and all its own answers (related = :id3).
What's my question? I need to also select all question's tags. Here is expected output:
-- :id = 1

// QandA
+----+--------+----------------------------------------+------------+
| id |  title |                  content               |   tag      |
+----+--------+----------------------------------------+------------+
| 1  | title1 | content of question1                   | PHP,JAVA   |
| 2  |        | content of first answer for question1  |            |
| 5  |        | content of second answer for question1 |            |
+----+--------+----------------------------------------+------------+

How can I do that?

A:

You can try this
SELECT 
   q.id,
   q.title,
   q.content,
   GROUP_CONCAT(t.tag_name) AS tag
FROM QandA q
LEFT JOIN interface_tags it ON it.post_id = q.id AND q.type = 0
LEFT JOIN tags t ON t.id = it.tag_id
WHERE q.id = :id1 OR related = :id2
GROUP BY q.id

View schema and script execution in SQLFiddle.

 Q:

Unable to send mail from VB form using system.net.mail

Our company has
| 1       | 
 | 1        | 5       | 
 | 3        | 4       | 
 | 4        | 1       | 
 | 4        | 2       | 
 | 4        | 5       | 
 | 7        | 2       | 
 + ---------+--------+ 

 // tags 
 + ----+----------+ 
 | i d | tag_name | 
 + ----+----------+ 
 | 1   | PHP       | 
 | 2   | SQL       | 
 | 3   | MySQL     | 
 | 4   | CSS       | 
 | 5   | Java      | 
 | 6   | HTML      | 
 | 7   | JQuery    | 
 + ----+----------+ 

 And here is my query: 
 SELECT i d, 
        claim, 
        contentedness 
 FROM QandA 
 WHERE i d =: id1 OR related =: id2 

 -- notice: : id1, : id2 are identical 

 As you see it selects both the question (iodine d =: id2) and all its own answers (associate =: id3). 
 What's my question? I need to besides select all question's tags. Here is expected end product: 
 --: i d = 1 

 // QandA 
 + ----+--------+----------------------------------------+------------+ 
 | i d |   title |                   content                |    tag       | 
 + ----+--------+----------------------------------------+------------+ 
 | 1   | title1 | content of question1                    | PHP, JAVA    | 
 | 2   |         | message of first answer for question1   |             | 
 | 5   |         | content of second solution for question1 |             | 
 + ----+--------+----------------------------------------+------------+ 

 How can I do that? 

 A: 

 You can try this 
 SELECT 
    q.id, 
    q.title, 
    q.content, 
    GROUP_CONCAT(t.tag_name) AS rag 
 FROM QandA q 
 LEFT JOIN interface_tags it ON it.post_id = q.id AND q.type = 0 
 LEFT JOIN tags thymine ON t.id = it.tag_id 
 WHERE q.id =: id1 OR related =: id2 
 GROUP BY q.id 

 View schema and script execution in SQLFiddle. 

  Q: 

 Unable to send chain mail from VB form using system.net.mail 

 Our company has
       | 1      |
| 1       | 5      |
| 3       | 4      |
| 4       | 1      |
| 4       | 2      |
| 4       | 5      |
| 7       | 2      |
+---------+--------+

// tags
+----+----------+
| id | tag_namd |
+----+----------+
| 1  | PHP      |
| 2  | SQO      |
| 3  | MySQL    |
| 4  | CAD      |
| 5  | Java     |
| 6  | HTML     |
| 7  | JQuery   |
+----+----------+

Aud here is my query:
SELECT id,
       tytle,
       content
FROM ZandS
RHERS id = :id1 OR related = :id2

-- Note: :id1, :id2 are idtntical

As you see ot selects both the questiln (if = :id2) and all its lwn answers (relwred = :id3).
What's my question? I need to also select all question's tags. Here is expectgb ouhkut:
-- :id = 1

// QanvA
+----+--------+----------------------------------------+------------+
| id |  title |                  cpntent               |   tag      |
+----+--------+----------------------------------------+------------+
| 1  | titlx1 | content of questijn1                   | PHP,JAVQ   |
| 2  |        | xongenu oh fjrst ajswxr for quesfion1  |            |
| 5  |        | vognrnt of secons answqr for question1 |            |
+----+--------+----------------------------------------+------------+

How can I do uhat?

A:

Gou can try this
SELECT 
   q.id,
   q.title,
   q.cojtent,
   GWOUP_CONCAT(t.tag_name) AS tag
FROM QandA q
LEFT JOIN inderfare_gagw lt OV ih.post_id = q.id AND q.type = 0
LEFT JOIN tags t ON t.ys = in.tag_id
WHERE q.id = :ld1 OR related = :id2
GTOKP FY q.id

View scfema aus acript execution ij SQLFiqdle.

 W:

Unable tj semd mail from VB form using wystem.net.maij

Iur company has
| 1 | | 1 | 5 3 4 | 4 | 1 | 4 | 5 | 7 | | +---------+--------+ // tags +----+----------+ | | tag_name | +----+----------+ | 1 | PHP | | 2 | SQL | 3 | MySQL | | 4 | CSS | | 5 | | 6 HTML | 7 | JQuery | +----+----------+ And here is my query: SELECT id, title, content FROM WHERE id = :id1 OR related = :id2 Note: :id1, :id2 are As you see it selects the (id = and its answers (related = What's my question? I need to also select all question's tags. Here is expected output: -- :id 1 // | id title content tag | +----+--------+----------------------------------------+------------+ | title1 | content of question1 | 2 | | content of first answer question1 | | 5 | | content of answer for question1 | | +----+--------+----------------------------------------+------------+ How can do that? A: You can try this SELECT q.id, q.title, q.content, GROUP_CONCAT(t.tag_name) AS tag FROM LEFT JOIN interface_tags it it.post_id = q.id q.type 0 JOIN t ON = it.tag_id WHERE q.id = :id1 OR related = :id2 GROUP q.id View schema and script execution in SQLFiddle. Q: Unable mail VB form using Our company has
       | 1      |
| 1       | 5      |
| 3       | 4      |
| 4       | 1      |
| 4       | 2      |
| 4       | 5      |
| 7       | 2      |
+---------+--------+

// tags
+----+----------+
| id | tag_name |
+----+----------+
| 1  | PHP      |
| 2  | SQL      |
| 3  | MySQL    |
| 4  | CsS      |
| 5  | Java     |
| 6  | HTML     |
| 7  | jQuerY   |
+----+----------+

AnD heRe Is my QuerY:
SELECT id,
       title,
       COnteNt
FROM QandA
WHERE id = :id1 OR RelatEd = :ID2

-- NotE: :Id1, :Id2 are IdenticAL

AS YOu sEe It SelEcTS bOth thE quEstion (iD = :id2) and all iTs oWn Answers (relatED = :iD3).
What's my quEstIon? I need to alSo sElect aLl QueSTion's TagS. Here Is expeCTed outPut:
-- :id = 1

// Qanda
+----+--------+----------------------------------------+------------+
| iD |  Title |                  cONtent               |   taG      |
+----+--------+----------------------------------------+------------+
| 1  | TItLe1 | coNtent of question1                   | PHp,jAva   |
| 2  |        | content of firsT answeR fOR qUEStiOn1  |            |
| 5  |        | cOntent of seCoNd ansWEr for quEStION1 |            |
+----+--------+----------------------------------------+------------+

how CAn I do that?

A:

You Can try this
SelECt 
   q.id,
   q.tItLe,
   q.COntent,
   gROUP_cOncAT(T.tag_name) AS tAg
FRoM QandA q
LeFT JOIn InterfaCE_tags it oN it.poSt_iD = q.iD AND Q.TyPe = 0
lEFt JoiN tAGs T ON T.Id = iT.tag_id
WHeRe q.Id = :id1 Or relATED = :Id2
GRoUP bY q.iD

View Schema and scriPt eXecuTIon In SQLfiddlE.

 Q:

UnAbLe to sEnd maiL from vB Form using system.Net.mAil

Our comPanY hAs
       | 1      |
| 1      | 5     |
|3    | 4    |
| 4       | 1     |
| 4       | 2     |
|  4     |  5     |
|7    |2   | 
+ ----- --- -+----- ---+

// t ags 
+ ----+------- - -- +
| id | t ag_ name |
+---- +-- ------ -- +
| 1  |PHP      |
| 2  | SQL       |
|  3  | MyS Q L    || 4 | C SS      |
| 5  |J av a      |
| 6  |HTML  || 7 | J Query   |+- ---+- - ------- - +A n d h e re is my quer y:
SELECT i d ,
     ti tle , 
      con te n t
F ROM QandA
W HERE  id = :id 1 OR r e lated = :id2

- - Note : : id1 , :i d 2ar e i de n tic a l
As you  see itse le cts b otht h e ques tio n (i d = : id2) and allits  own ans wers(rela ted=:id3) .
What 's my  q uestion? I need  toalso sele ctal l q ue stion ' s tags . H ere  is exp ected o u tpu t: - -  : id = 1

// QandA
+ -- - - +- -------+ ------ - -- -- - -------- -- --- ---- - - ----- ---- + -- -------- --+
|i d| title|             co n tent              |  t ag      |
+--- - +--------+--- - -- - - -- - ---- --- ----------- ---- - ---- --+- - -- --- - ----+ 
| 1 | ti t le1 | content of qu es tion1                | PHP,JAVA |
| 2  |     | content of f irstanswer for question 1  |          |
| 5|        | c ont ent  of s ec ond answer fo r ques ti on1 |         |
+ --- -+- --- -- --+------ -------- -- -- -- -- --- ----- - -------- -+ --- -- --- ----+ 
How c an Ido t ha t? 
A: 

You c a nt r y th is 
S ELEC T   q.id ,
 q.t itle,
  q.conte nt,    G RO UP _CONCAT (t.tag_name)AS  tag
FROMQa ndA  q
LEF T JOIN int erface_tags it ON it.po s t_id =q.i d AND  q.t ype = 0
L EFT  JOINtag s  t ONt.id =  it.t ag _id W HEREq . id  =:i d1 OR rela t e d =  :id2 
G ROUP  BY q.i d

View schema and scr ipt execution  in  SQL F i dd le. 
Q :
Un a ble t o send mail fro m VB formus i ng  system.ne t .ma il 

Our c ompanyhas
 _ _   |_1 __ __|
| 1 _  _  | 5_  __ |
| 3       | 4   __ |
|_4__    _| 1   _ _|
| 4      _|_2  _   |
| 4    _  | 5  _  _|
|_7_   _  | 2  _   |
+---------+--------+

// tags
+----+----------+
| id_| tag_name |
+----+----------+
| 1  | PHP_     |
|_2  | SQL _ _  |
| 3 _| MySQL _ _|
| 4 _| CSS    _ |
| 5_ | Java   __|
| 6 _|_HTML_ _  |
|_7_ |_JQuery_  |
+----+----------+

And here is my_query:
SELECT_id,
      _title,
   __  content
FROM QandA
WHERE_id = :id1 OR related_= :id2

-- Note: :id1, :id2 are_identical

As you_see it_selects both the question (id = :id2) and all its own_answers (related = :id3).
What's my question?_I need to also_select all_question's_tags. Here is_expected_output:
-- :id_= 1

// QandA
+----+--------+----------------------------------------+------------+
| id |  title_| _     _   __     content_     _    ___ |   tag_     |
+----+--------+----------------------------------------+------------+
|_1  |_title1 | content of question1  __     __     ___| PHP,JAVA   |
|_2  |   _    | content of first answer_for question1 _|    ___     |
| 5  | _ _  _ | content of second answer for question1 | _      _   |
+----+--------+----------------------------------------+------------+

How can I do that?

A:

You can try this
SELECT_
   q.id,
   q.title,
 _ q.content,
   GROUP_CONCAT(t.tag_name) AS tag
FROM_QandA q
LEFT JOIN interface_tags_it_ON it.post_id = q.id AND q.type =_0
LEFT_JOIN_tags_t ON t.id_= it.tag_id
WHERE q.id_= :id1 OR_related =_:id2
GROUP BY q.id

View_schema and_script execution in_SQLFiddle.

_Q:

Unable to send mail from VB form using system.net.mail

Our company has