2
SELECT
    EB.first_name AS FNAME,
    EB.emp_id AS EID,
    CONCAT(EB.first_name,' ',EB.mid_name,' ',EB.last_name) AS FULLNAME,
    EB.id AS ID,
    ESAL.dept_id AS DEPT_ID,
    DATE_FORMAT(EB.dob,'%D %b %y') AS DOB,
    EB.email_per AS EPER,
    EB.mobile_per AS MOBPER,
    EB.father_name AS FATHER,
    EB.mother_name AS MOTHER,
    EB.sex AS SEX,
    EB.email_office AS EOF,
    EB.mobile_office AS MOBO,
    EB.blood_group AS BG,
    CONCAT(EB.id_type,' : ',EB.id_no) AS ID,
    CONCAT(EB.present_addr,'<br>',EB.present_city_id,'<br>',EB.present_state_id) AS PRA
FROM mtc_employee_master EB
LEFT JOIN mtc_employee_education_master EE  ON EE.emp_tbl_id = EB.id
LEFT JOIN mtc_employee_experience_master EEXP ON EEXP.emp_tbl_id = EB.id
LEFT JOIN mtc_employee_salary_master ESAL ON ESAL.emp_tbl_id = EB.id WHERE EB.id=".$data['id']."

What I am trying to do to embed HTML content in concat of MySQL..is it possible?? Please help..

1 Answer 1

1

Yes it's possible, even if it not the best solution...

SELECT CONCAT('<p>', now(), '</p>') as html;
+----------------------------+
| html                       |
+----------------------------+
| <p>2015-04-27 13:12:33</p> |
+----------------------------+

and you have already done this in:
CONCAT(EB.present_addr,'<br>',EB.present_city_id,'<br>',EB.present_state_id,)
but you should delete comma: CONCAT(EB.present_addr,'<br>',EB.present_city_id,'<br>',EB.present_state_id)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.