aej1973
asked on
error on a specific line ...
When I run this code I keep getting a syntax error, can someone let me know what the issue could be?
echo '<input type="radio" name="status" value="1" id="status_1"'.if($row['vi sit_status '] == '1'){echo 'checked';}.'/>Complete</l abel>';
The error message I get is:
Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\module_p\e ditSchedul e.php on line 78
Thanks for the help.
A
echo '<input type="radio" name="status" value="1" id="status_1"'.if($row['vi
The error message I get is:
Parse error: syntax error, unexpected T_IF in C:\xampp\htdocs\module_p\e
Thanks for the help.
A
Unexpected in a PHP parse error means that something is wrong up the script above the line number location of the of the parse error. Maybe the error is in the same line or a line above it.
Maybe try changing the dot to a semi-colon.
I would probably code it this way.
<?php // RAY_temp_aej1973.php
$x = '<input type="radio" name="status" value="1" id="status_1"';
if($row['visit_status'] == '1')
{
$x .= ' checked';
}
$x .= '/>Complete</label>';
echo $x;
http://www.laprbass.com/RAY_temp_aej1973.php
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
karunamoorthy, perfect! This is what I was looking for.
A
A
ASKER
Thanks.