The following SQL statement in my page works fine, I would like to use the part: DATE_FORMAT(messages.created, '%d/%m/%Y') As created,
in my other SQL querySELECT messages.id AS message_id, messages.order_id, messages.customer_id,messages.subject,messages.body,DATE_FORMAT(messages.followup, '%d/%m/%Y') As followup,DATE_FORMAT(messages.created, '%d/%m/%Y') As created,DATE_FORMAT(messages.created,'%H:%i') AS created_time,messages.created_by,CONCAT_WS(' ',customers.firstname,customers.surname) AS customer,customers.email AS emailFROM messages INNER JOIN customers ON messages.customer_id = customers.idWHERE customers.consultant_id = '" . $consultant_id . "' ANDmessages.read = '" . $read . "'AND (messages.followup > 0 AND messages.followup <= '" . $timestamp . "')ORDER BY messages.id DESC LIMIT $start, $limit;
my other SQL query: I would like to add the following: DATE_FORMAT(messages.created, '%d/%m/%Y') As created,
but I am not sure how to add this in?!SELECT COUNT(*) as num FROM $tableName INNER JOIN customers ON messages.customer_id = customers.id LEFT JOIN consultants ON consultants.id = customers.consultant_id WHERE messages.read = '" . $read . "' AND (messages.followup > 0 AND messages.followup <= '" . $timestamp . "') AND customers.consultant_id = '" . $consultant_id . "' AND messages.created >= DATE_SUB(NOW(), INTERVAL 6 MONTH)