Learn how UDFs work in SQLite and PHP in this useful example, but will work differently on different systems.
- In this lesson, I'll show you some examples…of user defined functions for SQLite written in PHP.…This is guaranteed to work differently in database system,…this could give you an idea of the kinds of things…that you could do and the kinds of ways in which it'll work.…We're going to start by looking at the source code for SID.…This is my SQL Interactive Demonstrator…that we've been using that's this web page here.…This is written in PHP and I've written it…over the course of, it looks like, almost 10 years.…
Starting down here on line 73, and you've got this…in your exercise files and you're welcome…to use it for your own purposes…or even modify it as long as you give attribution.…So here in this init function, and under…switch database engine case SQLite3,…you'll notice that after I initialize the PDO…and get a database handle, then I create functions.…And createFunction, createFunction, createAggregate.…The functions are called "SEC_TO_TIME" and "TIME_TO_SEC"…for converting seconds into time notation…and time notation back into seconds.…
- Understanding SQL terminology and syntax
- Creating new tables
- Inserting and updating data
- Writing basic SQL queries
- Sorting and filtering
- Accessing related tables with JOIN
- Working with strings
- Understanding numeric types
- Using aggregate functions and transactions
- Automating data with triggers
- Creating views
- Defining functions in PHP
Skill Level Beginner
2. SQL Overview
3. Fundamental Concepts
7. Dates and Times
Dates and times1m 52s
11. Views and Subselects
12. Defined Functions
13. A Simple CRUD Application
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.