Chris Payne wrote:

Hi there everyone,

I'm pulling some sensitive data from a MySQL DB with PHP and the clients
wants the first x amount of numbers displayed on the screen to be xxxxxx etc
... rather than the numbers, but wants the last 6 to be displayed, is there
an easy way to do this?

I understand this isn't technically a DB question as such, but if someone
could point me in the right direction (IE: which function to read up on) I
would really appreciate it.


Well, it can technically be done in either the query itself or PHP, I prefer to do that sort of thing in the query.

Using MySQL I woudl do somehting like:


I didn't verify the RIGHT function ,but that sort of thing should be possible with any sort of DB server.

If I were doing it with PHP, it would be something like

$sColumn =  'xxxxxxxxxxxxxx'.substr($sColumn,-6);


PHP Database Mailing List (
To unsubscribe, visit:

Reply via email to