...

View Full Version : combine two PHP statments into one



musher
08-22-2006, 05:51 AM
I'm trying to combine these two lines into one

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

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.

boeing747fp
08-22-2006, 05:52 AM
what's the point?

musher
08-22-2006, 05:55 AM
what's the point?
I'm learning boeing :confused: and cant figure out how to, I know this one is kind of a bad example.

boeing747fp
08-22-2006, 05:55 AM
you cant use single quotes if you're going to add to the string

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";

musher
08-22-2006, 06:03 AM
AHHHHHH, Thanks boeing747fp



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum