[eluser]Maglok[/eluser]
There is a current bug that makes the profiler not display queries if you are running PHP 4 (which I am). I use active records to build my query, but I am getting errors.
I have 3 tables basically:
- personen
- inschrijvingen
- evenementen
inschrijvingen has both a persoon_id and a evenement_id, creating a unique pair. I want to select all the 'personen' that are in 'inschrijvingen' with a evenement_id that I give. So I wrote this:
Code:
$this->db->select('personen.voornaam, personen.tussenvoegsel, personen.achternaam, inschrijvingen.type');
$this->db->from('personen, inschrijvingen');
$this->db->where('inschrijvingen.evenement_id', $_GET['id']);
$this->db->where('inschrijvingen.persoon_id', 'personen.persoon_id');
$this->db->order_by('personen.achternaam','asc');
$query = $this->db->get();*/
If I try to call any of the data I get issues like:
Code:
A PHP Error was encountered
Severity: Notice
Message: Undefined property: achternaam
Filename: views/inschrijven_lijst.php
Line Number: 37
I tried putting the query directly in phpMyAdmin using this:
Code:
SELECT personen.voornaam, personen.achternaam, personen.tussenvoegsel, inschrijvingen.type
FROM personen, inschrijvingen
WHERE inschrijvingen.persoon_id = personen.persoon_id
AND inschrijvingen.evenement_id = 1
It selected no problem. I'd normally run the profiler but it is suffering from the bug, I am trying to find out just what query I am building with the active record.