Of course CONCAT() can and you know that. Thanks for the response and [cattle] prod. 🙂
bbmak, I was trying to show that it's silly to try and put it in the database as you keep insisting.
It's one half dozen of the other. Either you have to put 'gr-' in all the SQL or in your echo statements. Weedpacket, is talking about this:
$sql = "SELECT CONCAT('gr-', id) AS gr_id FROM table_name";
You can still utilize the constant option I mentioned before as well. That way you only have to change it in one place. Example:
define('PREFIX', 'gr-');
$sql = "SELECT CONCAT('" . PREFIX . "', id) AS gr_id FROM table_name";
Or select id normally and echo 'gr-' before the id like in my previous post.
It's your choice of how you wan to do it.
Good luck.