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 5 of 5
  1. #1
    Regular Coder musher's Avatar
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    203
    Thanks
    0
    Thanked 0 Times in 0 Posts

    combine two PHP statments into one

    I'm trying to combine these two lines into one
    Code:
    if (strcmp("0", $MyRow['recurring'])) {$jcm = "YES";}else{$jcm = "NO";}
    
    echo '<tr><td class="colmhdr">Recurring Event: </td><td><input class="text_display" type="Text" name="recurring" value="'.$jcm.'" size="2" maxlength="2" readonly="true" /></td></tr>';echo"\r\n";
    I've tried various versions of this
    PHP Code:
    echo '<tr><td class="colmhdr">Recurring Event: </td><td><input class="text_display" type="Text" name="recurring" value="'.if (!(strcmp("0"$MyRow['recurring']))) {echo "YES";}else{echo "NO";}.'" size="2" maxlength="2" readonly="true" /></td></tr>';echo"\r\n"
    but can't figure it out, or am I trying the impossible.
    Thanks
    Jim M

    "Lord, help me to become the person my dog thinks I am" - Dawn Ewing
    "If you must know. Yes, I do enjoy running after the dog sled when I fall off" - Me

    www.huskyzone.com -- Woodland Siberians

  • #2
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post
    what's the point?

  • #3
    Regular Coder musher's Avatar
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by boeing747fp
    what's the point?
    I'm learning boeing and cant figure out how to, I know this one is kind of a bad example.
    Thanks
    Jim M

    "Lord, help me to become the person my dog thinks I am" - Dawn Ewing
    "If you must know. Yes, I do enjoy running after the dog sled when I fall off" - Me

    www.huskyzone.com -- Woodland Siberians

  • #4
    Regular Coder
    Join Date
    Oct 2003
    Posts
    603
    Thanks
    2
    Thanked 1 Time in 1 Post
    you cant use single quotes if you're going to add to the string
    PHP Code:
    echo "<tr><td class=\"colmhdr\">Recurring Event: </td><td><input class=\"text_display\" type=\"Text\" name=\"recurring\" value=\"";if(!(strcmp("0"$MyRow['recurring']))) {echo "YES";}else{echo "NO";} echo "\" size=\"2\" maxlength=\"2\" readonly=\"true\" /></td></tr>\r\n"

  • #5
    Regular Coder musher's Avatar
    Join Date
    Jan 2005
    Location
    Minnesota
    Posts
    203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    AHHHHHH, Thanks boeing747fp
    Thanks
    Jim M

    "Lord, help me to become the person my dog thinks I am" - Dawn Ewing
    "If you must know. Yes, I do enjoy running after the dog sled when I fall off" - Me

    www.huskyzone.com -- Woodland Siberians


  •  

    Posting Permissions

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