Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    Regular Coder
    Join Date
    Jan 2006
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question if else... I'm going mad

    I have the following:
    Code:
    if ($myrow["Locked"] == 'YES'){
    	if ($myrow["RevisionStage"]["ProfViewed"] == "YES") {
    		echo "<a href=statuspage_2.php?Records=".$Records." style='text-decoration: none; color: #FF0000'> Check review status.</a>";
    	} else {
    		echo "<a href=statuspage_2.php?Records=".$Records." style='text-decoration: none; color: #000000'> Check review status.</a>";
    	}
    } else {
    	echo " <a href=addedit_2.php?Records=".$Records.">Edit</a> |
    	<a method='POST' href=emailconfirm_2.php?Records=".$Records.">Submit</a> |
    	<a href=delete_2.php?Records=".$Records.">Delete</a>";
    }
    I'm attempting to edit the following line so that both fields, RevisionStage and ProfViewed, will be checked at the same time.
    Code:
    	if ($myrow["RevisionStage"]["ProfViewed"] == "YES") {
    Presently the page loads without error but the above code seems to be ignored; the color of "Check review status." is remaining black.

    Attempted the following. But I'm definitely missing the correct syntax.
    ($myrow["RevisionStage"]["ProfViewed"] == "YES")
    ($myrow["RevisionStage"],["ProfViewed"] == "YES")
    ($myrow(["RevisionStage"],["ProfViewed"]) == "YES")
    ($myrow["RevisionStage","ProfViewed"] == "YES")
    ($myrow["RevisionStage,ProfViewed"] == "YES")
    ($myrow["RevisionStage"]&&["ProfViewed"] == "YES")

    Thanks in advance.

  • #2
    Senior Coder rafiki's Avatar
    Join Date
    Aug 2006
    Location
    Floating around somewhere...
    Posts
    2,043
    Thanks
    19
    Thanked 42 Times in 42 Posts
    PHP Code:
    ($myrow['RevisionStage']['ProfViewed'] == "YES"

  • #3
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    $myrow["RevisionStage"]["ProfViewed"] is attempting to reference a 2-dimensional array value (which is not defined I presume). You must do specify both variables you want to check:
    PHP Code:
    if ($myrow['RevisionStage'] == "YES" && $myrow['ProViewed'] == "YES") {
        ....


  • #4
    Regular Coder
    Join Date
    Jan 2006
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Smile

    Thanks guys!

    You have saved my sanity!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •