[eluser]tusukgigi[/eluser]
how to retrive data from the database with the same field names in the table
example:
users table
id | name | phone
1 tusuk gigi 08122222
2 tugi 021839039
products table
id | name | phone
1 php 04444444
2 java 02111111
model :
sql = SELECT a.id, a.name, a.phone, b.id, b.name, b.phone FROM products a
LEFT JOIN users b ON a.id = b.id
WHERE a.id='$id' LIMIT 1;
controller :
$data['hasPlace'] = $this->MPosts->cekOwnerPlace($id);
views :
echo $hasPlace['id'];
echo $hasPlace['name'];
echo $hasPlace['phone'];
wwith the code above I just get empty data.
whereas the data in the table is not empty