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 trialCaron Rumsey
2,683 PointsCRUD Operations with PHP. Reading Project cannot connect when add php to project_list.php file.
I followed the video, and have added the below PHP script in the project_list.php file but I get error when I view it in browser. I have checked and checked the script for comparison but cannot see where I'm going wrong. It all works fine until I enter this code.
The code I added to the project_list.php file is
<?php
foreach (get_project_list() as $item) {
echo "<li>" . $ item['title'] ."</li>;
}
?>
Thank you.
1 Answer
Niki Molnar
25,698 PointsHi Caron
If you copied and pasted the code you entered, then it looks like you're missing the final " after the </li>:
<?php foreach (get_project_list() as $item) { echo "<li>" . $ item['title'] ."</li>;
} ?>
should be
<?php foreach (get_project_list() as $item) { echo "<li>" . $ item['title'] ."</li>";
} ?>
Hope that helps!
Niki
Caron Rumsey
2,683 PointsCaron Rumsey
2,683 PointsThank you so much Niki.