Welcome Guest, Not a member yet? Register   Sign In
'get' problem on active record
#1

[eluser]quals_jack[/eluser]
using postgre
I do this:
$myQuery = $this->db->get('test11');
got error message as:

ERROR: syntax error at or near ")" LINE 2: FROM ("test11") ^
SELECT * FROM ("test11")

how can it becomes like 'SELECT * FROM ("test11")'?
#2

[eluser]tonanbarbarian[/eluser]
the active record code is trying to ensure that table and field names are escaped correctly so that they are not subject to SQL injection attacks

I think there is a bug in a number of the SQL drivers in that they do not escape correctly for the different databases

I am sure if you search the forums you will find examples of modifications you can make to fix it.
#3

[eluser]quals_jack[/eluser]
I got the same error message when using pgAdm to try 'SELECT * FROM ("test11"); '. So that means postgreSQL doesn't understand '("test11")'. maybe I should set somethingon postgreSQL?
#4

[eluser]Seppo[/eluser]
Take a look here, the first comment has the solution.
#5

[eluser]quals_jack[/eluser]
Thanks Seppo! It works now.




Theme © iAndrew 2016 - Forum software by © MyBB