Jump to content

[SOLVED] PHP If statement help


marksie1988

Recommended Posts

Hi,

 

i have written some code that i want to display an image but only if a field in my sql has information in it

 

i currently have:

 

if($req_user_info['Skype'] > 0){
		/* Skype */
		echo "<a href='callto://".$req_user_info['Skype'] ."'><img src='../images/icons/skype.gif' border='0'/></a>";
	}
	elseif($req_user_info['myspace'] > 0){
	/* myspace */
		echo "<a href='http://".$req_user_info['myspace'] ."'><img src='../images/icons/myspace.gif' border='0'/></a>";}
	else{echo "No Extras";}

 

i think that the problem is

                                             

      if($req_user_info['myspace'] > 0){

                                            ^^^

 

should i be saying is greater than 0 or not? im new to this so please help.

Link to comment
https://forums.phpfreaks.com/topic/59679-solved-php-if-statement-help/
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.