PostgreSql PHP query

2

Member of my group that handles in DB left us with problem. When I run the following command:

Query:

$query = "SELECT c.destino, c.origem, cc.data, cc.informacoes FROM " . $this -> name_entity . "  c, " . $this -> name_entity . "_tres cc where c.id_" . $this -> name_entity . " = cc.id_ " . $this -> name_entity; 

You are returning the error:

  

error: Warning: pg_prepare (): Query failed: ERROR: syntax error at or near "carona" LINE 1: ... carona c, carona_tres cc where c.id_carona = cc.id_ carona ^ in C: \ xampp \ htdocs \ carona-ecologica \ model \ repository \ Repository Entity.php

What syntax for this query I'm not able to develop?

help!

    
asked by anonymous 14.08.2015 / 19:58

1 answer

2

At the end of your code, there is a space between id_ and ride

 cc.id_ " . $this

Correct code:

 cc.id_" . $this
    
14.08.2015 / 20:16