PHP code for populating an html table stopped working when web site moved.

I have a php site that was running fine on Windows Server 2008 in IIS. That server is being decommissioned and I was given a Windows Server 2012 R2 Server running IIS 8.5. The site is working fine except for an html table that is poplulated by a call to a database on a Microsoft SQL Server. This code works fine on the previous server. I have attached the code at issue. It appears to be related to the odbc_fetch_row statement. Any guidance would be greatly appreciated since I have to have this site up and running on the new server by June 1st.
The database connection works for populating the rest of the page, so I know I am connecting to the database without issue. I can also run the SQL statement directly on the database and it returns data.

Thanks.


problem_code.txt (3.45 KB)

I forgot to mention in original post that the original server was running PHP 5.1.1 and the new server is running PHP 5.6.0

Just taking a stab in the dark, based on what someone posted. Try adding

[php]odbc_fetch_row($rs,0)[/php]

before

[php]while (odbc_fetch_row($rs))[/php]

You can also add

[php]error_reporting(E_ALL);
ini_set(“display_errors”, 1);[/php]

just after your <?php tag to show you any errors.

Thanks for the error reporting code. It said I ran out of allocated memory before it finished pulling data so my php code may be fine. i just need to have the server admin allocate more memory.

to update anyone who may be following this thread. there must be something different in the way PHP 5.6.0 handles pulling data using odbc_fetch_row. When I moved the site to PHP 5.6.0, the code attached ran ou of memory before it could complete. I ended up rolling back to PHP 5.3 and the same code works fine without issue.

Sponsor our Newsletter | Privacy Policy | Terms of Service