Codeigniter: Column 'id' in order-Klausel mehrdeutig ist

Bin ich mit CodeIgniter Active-Record-Klassen, und ich bin beim abrufen eine Fehlermeldung mit dem folgenden code:

$this->db->select("*");
$this->db->order_by("id");
$this->db->limit($limit, $offset);
$this->db->from("atoms");
$this->db->join("atommeta", "atommeta.atom_id = atoms.atom_id");

$query  = $this->db->get();

Produziert diesen Fehler:

Error Number: 1052

Column 'id' in order clause is ambiguous

SELECT * FROM (`atoms`) JOIN `atommeta` ON `atommeta`.`atom_id` = `atoms`.`atom_id` ORDER BY `id` LIMIT 10

Filename: /Applications/MAMP/htdocs/atom/models/atom_model.php

Line Number: 197

Zeile 197: $query = $this->db->get();

Irgendwelche Ideen, warum? Es scheint etwas zu tun mit der order_by

Da die Spalte name 'id' ist mehrdeutig... ... ...

InformationsquelleAutor daryl | 2011-12-14

Schreibe einen Kommentar