Postgresql PHP query

Asked

Viewed 44 times

2

Member of my group who has left us with problems. When I execute 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; 

Is returning the error:

error: Warning: pg_prepare(): Query failed: ERROR: syntax error at or near "hitchhiker" LINE 1: ... carona c, carona_tres cc Where c.id_carona = cc.id_carona in C: xampp htdocs carona-ecologica model repositorio Repositorioentidade.php

What syntax for this query that I am unable to develop?

help!

1 answer

2


There at the end of your code, there’s a gap betweenid_ and hitchhiker

 cc.id_ " . $this

Correct code:

 cc.id_" . $this

Browser other questions tagged

You are not signed in. Login or sign up in order to post.