A many-to-many relation requires an additional table to relate the two tables in relationship. In this article, by Ahsanul Bari and Anupom Syam, we will learn how to define associations in models for many-to-many relations. Then, we will look at how to retrieve, delete, and save related data from and into database tables using model association in this special type of relation.Read Working with Complex Associations using CakePHP in full
In this article by Mark Noble, we will learn about adding calendar to our web site. A calendar is a fantastic way of keeping customers coming back to your site and your business at regular intervals so that they can take advantage of specials, sales, and other time-limited events.
We will consider the example of an imaginary web site created for a restaurant called Good Eatin' Bistro. Chef Wanyama is the owner of the Good Eatin' Bistro, a popular upscale restaurant. You can check this web site at http://goodeatin.drupalbyexample.com/.
We will create a basic event calendar, which displays information about musical concerts, special events, and more, for the Good Eatin' restaurant.Read Adding Calendar to a Web Site using Drupal 6 in full
Database relationship is hard to maintain even for a mid-sized PHP/MySQL application, particularly, when multiple levels of relationships are involved because complicated SQL queries are needed. CakePHP offers a simple yet powerful feature called 'object relational mapping' or ORM to handle database relationships with ease.In CakePHP, relations between the database tables are defined through association—a way to represent the database table relationship inside CakePHP. Once the associations are defined in models according to the table relationships, we are ready to use its wonderful functionalities. Using CakePHP's ORM, we can save, retrieve, and delete related data into and from different database tables with simplicity, in a better way—no need to write complex SQL queries with multiple JOINs anymore!
In this article by Ahsanul Bari and Anupom Syam, we will have a deep look at various types of associations and their uses. In particular, the purpose of this article is to learn:
- How to figure out association types from database table relations
- How to define different types of associations in CakePHP models
- How to utilize the association for fetching related model data
- How to relate associated data while saving
Python Data Persistence using MySQL Part III: Building Python Data Structures Upon the Underlying Database Data
This article, the third one in the Python Data Persistence using MySQL series by Yuli Vasiliev, discusses how you can implement Python data structures representing data structures stored in the underlying database and then manipulate those data structures on the Python side.Read Python Data Persistence using MySQL Part III: Building Python Data Structures Upon the Underlying Database Data in full
Among other merits, Python is an ideal language for writing server-side scripts, allowing you to integrate interactive behavior with HTML. Persisting dynamic content to an underlying database is fairly straightforward. By installing an appropriate Python DB module, you get the ability to interact with the database of choice from within Python code, moving your application data in and out of the underlying persistent store.
This article by Yuli Vasiliev will walk you through the process of building a simple Python application that interacts with a MySQL database. In a nutshell, the application picks up some live data from a web site and then persists it to an underlying MySQL database.Read Python Data Persistence using MySQL in full