cormac Posted January 16, 2008 Share Posted January 16, 2008 Hi, New to the site! And I'm hoping someone can tell me the PHP code (or point me towards a tutorial that will help me) to do: in semi-technical terms: Check someone's membership status in one MySQL database field and if it is correct,then to display the records from a different database field, if their membership status is incorrect to display 'You must upgrade your account to see this information' in more simple terms Check an employers status - if they are a Gold Member it should display an employees telephone number - otherwise it should display 'You must upgrade your account to see this information' Thanks Link to comment https://forums.phpfreaks.com/topic/86314-display-records-if-a-condition-is-met-otherwise-display-you-must-upgrade/ Share on other sites More sharing options...
papaface Posted January 16, 2008 Share Posted January 16, 2008 //some code gets the account type $get = mysql_query("SELECT `telephone` FROM `tbl_name` WHERE `fieldname`='SOMETHING' ") or die (mysql_error()); if (mysql_num_rows($get) == 1) { if ($membertype = "gold") { list($tel) = mysql_fetch_array($get); echo $tel; } else { echo "You must upgrade your account to see this information"; } } else { echo "Telephone number not found"; } Something like that. Link to comment https://forums.phpfreaks.com/topic/86314-display-records-if-a-condition-is-met-otherwise-display-you-must-upgrade/#findComment-440970 Share on other sites More sharing options...
cormac Posted January 16, 2008 Author Share Posted January 16, 2008 Thanks papaface - I will try that tomorrow! Link to comment https://forums.phpfreaks.com/topic/86314-display-records-if-a-condition-is-met-otherwise-display-you-must-upgrade/#findComment-441286 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.