Jump to content

if statement issue


jason360

Recommended Posts

Hey guys,

 

I have an series of if statements that I believe to be correct, comparing to examples I have found.  Anyway, the first 2 parts of the if statement work providing "Content #1" and "Content #2", however "Content #3" will not echo out.

 

Instead of getting Content #3 it looks like I am getting a variation of Content #2.  Any ideas what I am doing wrong here?

 

Thank you!

 if($d['user_id'] == $_SESSION['user_id']):{ 
	
		
		$result = mysql_query( "SELECT member_vote FROM member_rank WHERE member_id=".$d['user_id']."" );
		
		list($vote) = mysql_fetch_array( $result );

		
		return '
			<div id="comment" >
				Content #1
			</div>
		';}
		
		elseif($d['user_id'] != $_SESSION['user_id']):{ 
	
		
		$result = mysql_query( "SELECT member_vote FROM member_rank WHERE member_id=".$d['user_id']."" );
		
		list($vote) = mysql_fetch_array( $result );

		
		return '
			<div id="comment" >
				Content #2
			</div>
		';}
		
		
		else: {
		
		$result = mysql_query( "SELECT member_vote FROM member_rank WHERE member_id=".$d['user_id']."" );
		
		list($vote) = mysql_fetch_array( $result );	
		
		
		return '
			<div id="comment" >
				Content #3
			</div>
		';}
		
		
		endif;
Link to comment
https://forums.phpfreaks.com/topic/284664-if-statement-issue/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.