DB2 Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsDatabasesDB2 Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 11th, 2009, 05:32 PM
dfordinal dfordinal is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2009
Posts: 2 dfordinal User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 10 sec
Reputation Power: 0
Data corruption using ODBC_Connect in PHP when over 32,767 rcds returned

I have a program written in PHP on a Linux system. I am running a query that retrieves all the records from a table in a DB2 database running on an IBM iSeries server. I am using ODBC_Connect to get the data. Around 94,000 records are being returned in the query with 15 being displayed on a page at a time. The data is being displayed in a table with basic info from each record. When I have more than 32,767 records the 32,767th record begins replacing every other row after it is displayed in the table. For example. I have the following records: recordid = 32765, name=client 765; recordid = 32766, name=client 766; recordid 32767, name client 767; recordid 32768, name client 768; recordid 32769, name client 769; etc. When they are displayed in the table you will have:
Record ID Name
32765 Client 765
32766 Client 766
32767 Client 767
32768 Client 768
32767 Client 767
32770 Client 770
32767 Client 767

You'll notice that record #s 32769 abd 32771 are not displayed, 32767 has replaced them. This will continue for every other succeeding row in the result set. Every other row in the result set is replaced with the data for record 32767.

I am using the following PHP code to get at the records. xx is incremented by 15 each sucessive page that is called and $rowNum specifies at which record number to begin showing te results on the page:
sqlQuery .= " FETCH FIRST xx ROWS ONLY";
$resultset = odbc_exec($odbcConn, $sqlQuery);
while ($row = odbc_fetch_array($resultset, $rowNum)){
displayRowAssoc($row);
$rowNum++;
}

Does anyone know if this could be a problem with ODBC, PHP, DB2, a combination of the 3....? I have done exhaustive searches on Google to no avail. I hope someone here can help me.

Reply With Quote
Reply

Viewing: Dev Shed ForumsDatabasesDB2 Development > Data corruption using ODBC_Connect in PHP when over 32,767 rcds returned


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 5 Hosted by Hostway
Stay green...Green IT