I have a script in which i'm retrieving the information from a mysql databse.
The Script allows members who have a certain membership to be allowed to view certain parts of a webpage.
So if you have a free membership then you can't access some webpages, but if you have a paid membership then you can access them.
What i have right now is the following:
<?php
//Selects the information from the databse
$sql = "SELECT * FROM members WHERE memberID='$memberID'";
$run = mysql_query($sql) or die(mysql_error());
$num = mysql_num_rows($run);
while($fetch = mysql_fetch_assoc($run)){
$memberUser = $fetch['username'];
$membershipType = $fetch['membership'];
}
//This is the part were i'm not sure how to go about...I want people who have a bronze membership under the membership field in the databse to show the following
if($membershipType = bronze){
$msg = '
<ul>
<li>If this content appears then you have a paid membership</li>
<li>If this content appears then you have a paid membership</li>
</ul>';
}else{
//otherwise if it says free under membership in the database show the following
if($membershipType = free){
$msg = '<p>In order to access the content below you must have a paid membership</p>
<ul>
<li>If this content appears grayed out then you have a free membership and cannot access the files</li>
<li>If this content appears grayed out then you have a free membership and cannot access the files</li>
</ul>
<p>If you wish to access the content, please purchase a membership</p>';
}
}
?>
I'm not sure if i should make an array...if so how should i do it Any help would be greatly appreciate it.
The Script allows members who have a certain membership to be allowed to view certain parts of a webpage.
So if you have a free membership then you can't access some webpages, but if you have a paid membership then you can access them.
What i have right now is the following:
<?php
//Selects the information from the databse
$sql = "SELECT * FROM members WHERE memberID='$memberID'";
$run = mysql_query($sql) or die(mysql_error());
$num = mysql_num_rows($run);
while($fetch = mysql_fetch_assoc($run)){
$memberUser = $fetch['username'];
$membershipType = $fetch['membership'];
}
//This is the part were i'm not sure how to go about...I want people who have a bronze membership under the membership field in the databse to show the following
if($membershipType = bronze){
$msg = '
<ul>
<li>If this content appears then you have a paid membership</li>
<li>If this content appears then you have a paid membership</li>
</ul>';
}else{
//otherwise if it says free under membership in the database show the following
if($membershipType = free){
$msg = '<p>In order to access the content below you must have a paid membership</p>
<ul>
<li>If this content appears grayed out then you have a free membership and cannot access the files</li>
<li>If this content appears grayed out then you have a free membership and cannot access the files</li>
</ul>
<p>If you wish to access the content, please purchase a membership</p>';
}
}
?>
I'm not sure if i should make an array...if so how should i do it Any help would be greatly appreciate it.