Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

PHP Build a Simple PHP Application Listing Inventory Items Associative Arrays

I think I can not resolve this unless that you can help me.

Please would somebody (of more expert than me) can help me to resolve this challenge. I am totally exhausted. I checked several times the Randy movie about this lesson but I don’t find the way how to solve the problem. This is the challenge: Right now, the three <td> elements have information about the original movie as static pieces of text. Replace each of those with PHP commands that INSTEAD display information about the new movie from the array instead. (Be sure to leave the<td> tags intact.) And this is so far what I’ve done:

<?php $movie = array( "title" => "The Empire Strikes Back", "year" => 1980, "director" => "Irvin Kershner", "imdb_rating" => 8.8, "imdb_ranking" => 11 );

?>

<h1><?php echo $movie["title"]; ?> (1980)</h1>

<table> <tr> <th>Director</th> <td><?php echo $movie["director"]; ?></td> <td>Robert Zemeckis</td> </tr> <tr> <th>IMDB Rating</th> <td><?php echo $movie["imdb_rating"]; ?></td> <td>8.5</td> </tr> <tr> <th>IMDB Ranking</th> <td><?php echo $movie["imdb_ranking"]; ?></td> <td>53</td> </tr> </table>

Hi Ed,

See if you can get your code formatted correctly because it's hard to read like this and it strips out your html tags.

https://teamtreehouse.com/forum/posting-code-to-the-forum

Let us know too what task you're on.

4 Answers

John Imperio
John Imperio
9,486 Points

Hi Ed,

I revisited the code challenge from this course and please correct me If I'm wrong but it looks like you've forgotten to remove the original static pieces of text ("Robert Zemeckis", 8.5, 53). I also don't see you having an echo statement on the year. You're well on your way - just be mindful of the instructions as they can be less forgiving at times. Good luck!

Your are right. But when I removed those elements again the page indicated that the answer is wrong. So that's I put back again in the whole code in order to show in the forum where I am and what's I need to do and find the correct answer.

John, I did removed some elements and this is what I got: <th>Director</th> <td> <?php echo $movie["director"]; ?> </td>

<th>IMDB Rating</th> <td> <?php echo $movie["imdb_rating"];?> </td>

<th>IMDB Ranking</th> <td> <?php echo $movie["imdb_ranking"]; ?> </td>

and again Bummer! The HTML for this page is not quite right.

I resolve the issue. Thanks everybody!