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 trial
Matthew Davies
5,685 PointsConnecting PHP to MySQL - Selecting products
In the code challenge it asks me to write the SQL query to select 'name' and the 'price' from the 'products' table.
My code is: SELECT name, price FROM products;
It tells me this is wrong, and I don't know why.
4 Answers
Bryant Maroney
Courses Plus Student 991 PointsIt should actually be:
SELECT `name`, `price` FROM `products`;
lina Hernandez
4,583 PointsI have try this ...
< SELECT name, price FROM products
No luck
Ed white
13,291 Pointslooks right to me.. are you sure it is products ( plural) and not 'product'?
Matthew Davies
5,685 PointsYes, the column names and table name are definitely correct.
Ed white
13,291 PointsHave you tried it again, I was having a problem with a different code challenge last night and it turned out that there was a problem with the challenge engine, they fixed it last night
james white
78,399 PointsYou don't need a semi-colon at the end. It's just:
SELECT name, price FROM products