...

View Full Version : Simple IF Statement problem!



greens85
02-24-2010, 02:45 PM
Hi all,

I have a very basic if statement, but I am receiving the error:

Parse error: syntax error, unexpected '}', expecting ',' or ';' in /path/to/file/jobenquire.php on line 112

However, I can't see anything wrong with the statement. There doesn't appear to be an extra } or anything. Can anyone tell me what I am overlooking?


<?php
if (!empty($row['hours'])) {
echo $row['hours'];
} else { // This is line 112
echo "Not Supplied"
}
?>

Many thanks,

Greens85

SKDevelopment
02-24-2010, 02:50 PM
echo "Not Supplied";

; has been missing at the end of the line.

angst
02-24-2010, 02:50 PM
try this;



<?php
if (!empty($row['hours'])) {
echo $row['hours'];
} else {
echo "Not Supplied";
}
?>

greens85
02-24-2010, 03:03 PM
try this;



<?php
if (!empty($row['hours'])) {
echo $row['hours'];
} else {
echo "Not Supplied";
}
?>


Thats done the trick, thanks very much...

I did actually try it with the ; after the not supplied, but I must have been missing something else!



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum