Welcome Guest, Not a member yet? Register   Sign In
CI2 - Why am I getting this database error: Not unique table/alias
#1

[eluser]dallen33[/eluser]
PHP
Code:
<?php
    $query = $this->db->get('heritage');
    
    foreach ($query->result() as $row):
        echo $row->name;
    endforeach;
?>

Result
Code:
A Database Error Occurred
Error Number: 1066
Not unique table/alias: 'heritage'
SELECT * FROM (`heritage`, `heritage`)
#2

[eluser]KingSkippus[/eluser]
We need more context. What are you doing with $this->db above the lines you quoted above?
#3

[eluser]pickupman[/eluser]
This could be caused by a table and field having the same name. What are your columns in the 'heritage' table. Or do you have a stored procedure by the same name?




Theme © iAndrew 2016 - Forum software by © MyBB