Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialBartosz Jozwiak
Courses Plus Student 705 PointsIt won't accept my code.
It won't accept this code. Why?
<?php
$name = "Mike";
if ( $name == "Mike")
{
$statement = "Hi, I am Mike"
};
?>
3 Answers
Logan R
22,989 PointsYou misplaced your semi-colon.
Instead of putting it after the }
, you need to put it after the statement.
<?php
$name = "Mike";
if ( $name == "Mike")
{
$statement = "Hi, I am Mike";
}
?>
Hope this helps :)
Richmond Lauman
28,793 PointsHi Bartosz. In your if statement you have a semi colon where it does not belong and you are missing a semi colon on a statement where it does belong.
Bartosz Jozwiak
Courses Plus Student 705 PointsI works now. Thanks! :)
Jason Anello
Courses Plus Student 94,610 PointsHi Bartosz,
It's a good idea to post the solution so that others with a similar problem will have the solution.
In this case, it looks like there was 2 more problems beyond the missing semicolon.
You needed to echo the string and it needed an exclamation mark at the end.
Richmond Lauman
28,793 PointsRichmond Lauman
28,793 PointsYup