Viewers: in countries Watching now:
Now that PHP has true object-oriented capabilities, it's best practice to access databases using PDO (PHP Data Objects) and MySQLi. These methods produce database-neutral code that works with over a dozen systems, including MySQL, SQL Server, PostgreSQL, and SQLite. Learn how to use PDO and MySQLi to perform basic select, insert, update, and delete operations; improve security with prepared statements; and use transactions to execute multiple queries simultaneously. Author David Powers also covers advanced topics like instantiating custom objects, and compares PDO to MySQLi so you can decide which method is right for you.
On Mac OS 10 and Linux, you need to change the permissions on the SQLite data file, so that the web server can write to it as well as read. No changes are necessary on Windows. Making the change on Mac OS 10 is very easy. After copying the exercise files to a folder inside your testing server route, open the SQL Lite folder. Then select oophp.db, and press Cmd+I to bring up an Info pane. At the bottom right of the Info pane is a little padlock icon, click that, and enter your Mac administrator password when prompted.
If necessary, expand sharing and permissions and then set everyone, set the privilege from read only to read and write. And then click the padlock icon again. That will lock the setting and close the Info pane. And that's all there is to it. On Linux, you can make the changes using the CHMod command in a terminal window. The setting depend on how your system is set up. But if in doubt CHMod OOPHP.DB to 666.
There are currently no FAQs about Accessing Databases with Object-Oriented PHP.
Access exercise files from a button right under the course name.
Search within course videos and transcripts, and jump right to the results.
Remove icons showing you already watched videos if you want to start over.
Make the video wide, narrow, full-screen, or pop the player out of the page into its own window.
Click on text in the transcript to jump to that spot in the video. As the video plays, the relevant spot in the transcript will be highlighted.