Question : Condition statement to change wording in div block

I have a query that works great and took a while to work with.  Now I need to place a coditional either inside the div block or around it to have the wording "answered the Question" change to what I want depending on what tables is being pulled at that time.  I hope that makes since. I will be adding two or three more tables from the database once I have this working.

Let me know if you need anymore explanation.
Code Snippet:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:

                    
""
[ ] [Recategorize] Edit]") : ("") ?>Answered: " . date('F, j Y', strtotime($c['updated'])) . " " . date('g:i a', strtotime($c['updated'])) . "
") : ("") ?>

Answer : Condition statement to change wording in div block

>Also, I will be adding to my query based on the amount of tables will be output to this page.
Next stage.

We want to see "answered the Question" or "posted the How To"

So modify your script. I think I understand what you really want. No need of COUNT and GROUP.

Use :

     if($c['type'] == 'A') {
          echo "answered the Question";
     } else {
          echo "posted the How To";
     }

Or in the HTML :

"
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
$grabContribs = "SELECT answers.user, answers.answer, answers.qID, user_question.question, answers.date, user_question.id uID, user_question.make, user_question.model, 'A' 'type'
							FROM answers
							LEFT JOIN user_question ON answers.qID = user_question.id
							WHERE answers.user = '$user'
user_question.make, user_question.model
							UNION
							SELECT how_to.user, how_to.howto, how_to.id hID, how_to.question, how_to.date, NULL, how_to.make, how_to.model, 'H' 'type'
							FROM how_to
							WHERE how_to.user = '$user'
							ORDER BY date DESC";
Random Solutions  
 
programming4us programming4us