Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll

- 2x 2x
- 1.75x 1.75x
- 1.5x 1.5x
- 1.25x 1.25x
- 1.1x 1.1x
- 1x 1x
- 0.75x 0.75x
- 0.5x 0.5x
Out of all of the interactions performed on a database, the most often used command is a select statement. The select statement asks our database for data and retrieves those results. We’ll also look at how to handle errors with a query.
Example Code
try {
$db->query("SELECT title, category FROM Media");
} catch (Exception $e) {
echo "Bad query";
}
How to Ask Questions the Smart Way
Learning to query a database is an important part of programming, but learning to ask questions is even more important. Here is a great resource for leaning How to Ask Questions the Smart Way.
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up-
Neven Shtiliyanov
3,973 Points0 Answers
-
Siraj Khan
3,451 Points3 Answers
-
Siraj Khan
3,451 PointsWhy do I see only "Unable to retrieve results".? Even if everything is in place. Below is my code:
Posted by Siraj KhanSiraj Khan
3,451 Points0 Answers
-
Damian Toczek
4,471 Points1 Answer
-
Alex Forseth
8,017 PointsWhat does the information stored look like? How was it created?
Posted by Alex ForsethAlex Forseth
8,017 Points1 Answer
-
sameh salah
4,635 PointsHave a nice day , i wonder if you have video teach me how insert data in MySQL database ?
Posted by sameh salahsameh salah
4,635 Points1 Answer
-
James Dawson
2,770 PointsWhere is the database? Am I able to view where all this data is coming from?
Posted by James DawsonJames Dawson
2,770 Points0 Answers
-
Asad Kashmiry
219 Points0 Answers
-
Leon Segal
14,754 Points3 Answers
-
Psonisma Design
8,111 Points1 Answer
-
Volodymyr Danileichenko
7,354 Points2 Answers
View all discussions for this video
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up