If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Divide query results (PHP via ODBC connect)

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-05-03, 06:23
domm domm is offline
Registered User
 
Join Date: Oct 2003
Posts: 1
Divide query results (PHP via ODBC connect)

Hi,
I take data from DB2 database using ODBC connection and PHP script (Apache2+PHP4 on Windows 2000). My DB2 version is 4, its platform is AS/400.
Everything is OK, it works quite good, but I have a little problem with divide query results. In MySQL database I used syntax: "SELECT ... FROM ... WHERE .. LIMIT X,Y", but it doesn't work properly with DB2. I'm know that permitted is syntax: "... FETCH FOR FIRST X ROWS ONLY", but it is useful only for "X" first rows. Suppose that my query gives 500 rows. At first I need really first 50 rows (for example), but later I need records from 50 to 100, 150 to 200 etc. (just divide received data).
In this case, using MySQL I just added ".. LIMIT X,Y" (providing properly variables instead of X and Y) and it worked good.
Does anybody had such problem?
Sorry if smilar post is in this forum, I sought but I didn't find anything. In this case just please give me a link to this post.
On the other hand, I'd be delighted to get to know other experiences about connecting PHP->DB2 or ASPX->DB2 via ODBC.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On