Page 1 of 1
query error
Posted: Thu Jan 05, 2006 11:47 pm
by thcc2
I have the following statement that give me error
Code: Select all
$sql_text = $sql_text . " LIMIT $start, $maxresult";
$query = pg_query($dbconn, $sql_text);
it gives me an error of
Warning: pg_query(): Query failed: ERROR: LIMIT #,# syntax is not supported HINT: Use separate LIMIT and OFFSET clauses. in
hope someone can help me.
Posted: Fri Jan 06, 2006 12:59 am
by feyd
it just explained what the error means..
Posted: Fri Jan 06, 2006 1:05 am
by thcc2
feyd wrote:it just explained what the error means..
is that anything wrong with my query statement?
Posted: Fri Jan 06, 2006 2:30 am
by John Cartwright
Not to be rude, but pay attention to what the error is saying
Warning: pg_query(): Query failed: ERROR: LIMIT #,# syntax is not supported HINT: Use separate LIMIT and OFFSET clauses. in
Posted: Fri Jan 06, 2006 3:15 am
by thcc2
Jcart wrote:Not to be rude, but pay attention to what the error is saying
Warning: pg_query(): Query failed: ERROR: LIMIT #,# syntax is not supported HINT: Use separate LIMIT and OFFSET clauses. in
I think this line of code is invalid in PostgresSQL, can u please tell me what's wrong with the statement, i think it is valid for MySQL only.
Thks
Posted: Fri Jan 06, 2006 3:32 am
by John Cartwright
I think this line of code is invalid in PostgresSQL, can u please tell me what's wrong with the statement, i think it is valid for MySQL only.
Bang on. So the next logical step would be to visit
postgresql.org's manual and search for
Limit Offset, would it not?
Posted: Fri Jan 06, 2006 3:57 am
by thcc2
Jcart wrote:I think this line of code is invalid in PostgresSQL, can u please tell me what's wrong with the statement, i think it is valid for MySQL only.
Bang on. So the next logical step would be to visit
postgresql.org's manual and search for
Limit Offset, would it not?
I had changed my code to
Code: Select all
$sql_text = $sql_text . " LIMIT $start " OFFSET "$maxresult";
it gives me an error of
Parse error: parse error, unexpected T_STRING
I don't know what's wrong with it?
Posted: Fri Jan 06, 2006 4:33 am
by mickd
i dont use postgre sql but my guess is
Code: Select all
$sql_text = $sql_text . " LIMIT $start OFFSET $maxresult";
Posted: Sun Jan 08, 2006 8:25 pm
by thcc2
mickd wrote:i dont use postgre sql but my guess is
Code: Select all
$sql_text = $sql_text . " LIMIT $start OFFSET $maxresult";
Thks you are right.
Posted: Sun Jan 08, 2006 8:30 pm
by timvw
thcc2 wrote:
Code: Select all
$sql_text = $sql_text . " LIMIT $start " OFFSET "$maxresult";
Parse error: parse error, unexpected T_STRING
That's not a SQL problem but a PHP problem. Everything (and more) that you need to know about strings is at
http://www.php.net/string.
Posted: Mon Jan 09, 2006 10:57 pm
by thcc2
timvw wrote:thcc2 wrote:
Code: Select all
$sql_text = $sql_text . " LIMIT $start " OFFSET "$maxresult";
Parse error: parse error, unexpected T_STRING
That's not a SQL problem but a PHP problem. Everything (and more) that you need to know about strings is at
http://www.php.net/string.
Thks for ur reply.