Can't get my head around titleColumn...

Hi All.
Sorry for the newbie post, but I want to get this sorted out before my current enthusiasm wanes...
I'm trying to use the titleColumn method to name my records. Unfortunately, the complexity of my database schema exceeds my knowledge...
I've got three tables relevant here - I've got Trip, People, and Booking. Booking is a set of records containing a TripID and a PeopleID, to put people onto a trip.
So what I'm trying to do is to intercept the naming for each given booking, and replace it with the person's name from the People table and the dat from the Trip table. Here's some SQL that does roughly what I want :
SELECT CONCAT(FirstName, ' ', LastName, ' ', StartDate) AS BookingTitle FROM People LEFT JOIN (Booking, Trip) ON People.id = Booking.PersonID AND Trip.id = Booking.TripID; .
So I put that into fields.ini, and my delegate class contains simply:
function titleColumn() {
return "BookingTitle";
}
- I found this approach on the forum after some searching.
Trouble is - it doesn't work. I get an error:
Fatal error: Error retrieving title from database in Dataface_QueryTool::getTitles():SELECT `id`,`BookingTitle` as `__titleColumn__` FROM `Booking`Unknown column 'BookingTitle' in 'field list'
...And at that point, I'm so far out of my depth it's just not funny any more.
Can anyone point me at my error?
Thanks!
Vic.
Sorry for the newbie post, but I want to get this sorted out before my current enthusiasm wanes...
I'm trying to use the titleColumn method to name my records. Unfortunately, the complexity of my database schema exceeds my knowledge...
I've got three tables relevant here - I've got Trip, People, and Booking. Booking is a set of records containing a TripID and a PeopleID, to put people onto a trip.
So what I'm trying to do is to intercept the naming for each given booking, and replace it with the person's name from the People table and the dat from the Trip table. Here's some SQL that does roughly what I want :
SELECT CONCAT(FirstName, ' ', LastName, ' ', StartDate) AS BookingTitle FROM People LEFT JOIN (Booking, Trip) ON People.id = Booking.PersonID AND Trip.id = Booking.TripID; .
So I put that into fields.ini, and my delegate class contains simply:
function titleColumn() {
return "BookingTitle";
}
- I found this approach on the forum after some searching.
Trouble is - it doesn't work. I get an error:
Fatal error: Error retrieving title from database in Dataface_QueryTool::getTitles():SELECT `id`,`BookingTitle` as `__titleColumn__` FROM `Booking`Unknown column 'BookingTitle' in 'field list'
...And at that point, I'm so far out of my depth it's just not funny any more.
Can anyone point me at my error?
Thanks!
Vic.