Re: How to use FIRST select clause in IUS V9.12.UC2
Posted in 2000
Harrison
PHP3 supports SCROLL cursors (only because Informix does too), so the code may
look something like this...
<HEAD>
<?PHP
function show_page($pagenumber)
{
$cid = ifx_pconnect();
...
$rid = ifx_prepare($sqlstr, $cid, IFX_SCROLL);
ifx_do($rid);
$rownum = ($pagenumber * 15) + 1;
for ($i = $rownum; $i < ($rownum + 15); $i++)
{
$row = ifx_fetch_row($rid, $i);
// get values of each column and display here...
}
ifx_free_result($rid);
...
ifx_close($cid);
Note that the ifx_pconnect (or ifx_connect) and ifx_close should be called only
once.
Harrison Teng <harrison@sh.east.cn.net> on 03/16/2000 09:47:39 PM
Please respond to Harrison Teng <harrison@sh.east.cn.net>
To: informix-list@iiug.org
cc:
Subject: How to use FIRST select clause in IUS V9.12.UC2
Hi,All:
We are using PHP3 to access INFORMIX-Universal Server Version 9.12.UC2 on
UNIX (solaris) to build the dynamic webpage.
Our Question is how to achieve that show first 15 selected results in
first page and then show next 15 selected results in next page.
We have tried to use FIRST select clause in the query just like the
following format:
select first 15 username from customer;
but it failed, system responsed that "Syntax Error",we guessed that Maybe
this SELECT CLAUSE only can be used in Enterprise Dynamic Server, Right?
It it is , How to achieve it without using SELECT CLAUSE ?
Waiting for your help .
Thanks in advance.
Thanks a lot !
2000.03.17