stuart7398 Posted April 11, 2008 Share Posted April 11, 2008 Hi. When a user adds a telephone number to their profile i want the last 3 digits hidden, when the profile goes online. when a different member has paid for membership then the last 3 digits will appear. 09876 987 *** 09876 987 876 i'm not sure whether this is a php or mysql topic. any help appreciated. Thanks, Stuart. Link to comment https://forums.phpfreaks.com/topic/100577-hiding-details/ Share on other sites More sharing options...
AP81 Posted April 11, 2008 Share Posted April 11, 2008 $sPhone = '09876 987 876' $sSecurePhone = substr($sPhone,0,9) . ' ***' Link to comment https://forums.phpfreaks.com/topic/100577-hiding-details/#findComment-514474 Share on other sites More sharing options...
AP81 Posted April 11, 2008 Share Posted April 11, 2008 You could also do it in MySQL like this: SELECT CONCAT(LEFT(PHONE,9), ' ***') FROM tablename Link to comment https://forums.phpfreaks.com/topic/100577-hiding-details/#findComment-514477 Share on other sites More sharing options...
stuart7398 Posted April 11, 2008 Author Share Posted April 11, 2008 Hi. Thanks, however i'm still learning both php and mysql. The following gives me the error. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FROM members CONCAT(LEFT(PHONE,9), ' ***'WHERE member_id = '1'' at line 1 [code ]<?php require '../config.php'; require '../opendb.php'; $data = mysql_query("SELECT CONCAT(LEFT(PHONE,9), ' ***' FROM members WHERE member_id = '$SESS_MEMBER_ID'") OR DIE (mysql_error()); $info = mysql_fetch_array( $data ); { Print "<table style='table-layout:fixed; width:100%' class='up_account'>"; Link to comment https://forums.phpfreaks.com/topic/100577-hiding-details/#findComment-514618 Share on other sites More sharing options...
AP81 Posted April 11, 2008 Share Posted April 11, 2008 You are missing a bracket. You need another bracket after the asterisks': SELECT CONCAT(LEFT(PHONE,9), ' ***') Link to comment https://forums.phpfreaks.com/topic/100577-hiding-details/#findComment-514812 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.