php
codice:
$stringa = substr($stringa, 0, 3);
mysql
codice:
select left(colonna, 3) from tabella;