Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.