home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2776
Discussions: 186,609, Posts: 2,227,069, Members: 230,244
Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
Old June 23rd, 2008, 04:57 PM   Digg it!   #1 (permalink)
Senior Member
 
bwcc's Avatar
 
Join Date: Nov 2001
Location: Central KS
Posts: 830
Strange behavior in IE/SQL/PHP

I am having an issue recently with IE (v7.0.5730.11) displaying more than 500 records from an SQL query. The browser seems to constantly execute - displaying and rehiding records (and the vertical scrollbar grows and shrinks). I have let the page go for about 5 minutes and it will continue this behavior until a user clicks on the webpage a second time.

I've tried connecting to multiple databases, different webservers, different computers.

Here's the code (stripped down version)

PHP Code:
<?
$server
="someserver";
$username="someuser";
$password="somepwd";
$sqlconnect=mssql_connect($server$username$password);
$sqldb=mssql_select_db("sometable",$sqlconnect);
?>
<html>
<head>
  <title>Parking Control : Reports</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <link href="lpac.css" rel="stylesheet" type="text/css" />
</head>
<body>
<?
$rep
=mssql_query("SELECT TOP 1500 account FROM entries");
?>
<div>
  <span class="title" style="width:70px;"><a href="reports_print.php?o=1&<?=''.$v.''?>" title="Sort by Ticket #">Ticket#</a></span>
  <span class="title" style="width:75px;"><a href="reports_print.php?o=2&<?=''.$v.''?>" title="Sort by Date">Date</a></span>
  <span class="title" style="width:65px;"><a href="reports_print.php?o=3&<?=''.$v.''?>" title="Sort by Paid or Void">Paid/Void</a></span>
</div>
<div>
<?
    
for($i=0$i<1500$i++) {
        
$row mssql_fetch_array($rep);
        echo 
'
        <div style="clear:both;">
        <span class="data" style="width:70px;">'
.$row['account'].'</span>
        </div>'
;
    } 
// end while
?>
</body>
</html>
I've also changed the for statement to a while statement. Same results.
Firefox seems to execute the code normally, as IE used to. Any ideas to this strange behavior?
__________________
Im against picketing, but I dont know how to show it.


Last edited by bwcc : June 23rd, 2008 at 04:59 PM.
bwcc is offline   Reply With Quote
TechIMO.com Ads - Login or register for less ads.
How many errors does your computer have?

You no longer need to guess! This free stability scan and registry cleaner download will give you a complete diagnosis of your Windows registry, identifying errors and conflicts.

FREE instant scan


Guest, Register Free! to remove this ad and get your tech support questions answered in minutes!
Old June 24th, 2008, 07:46 AM     #2 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
i could suggest change 1500 to mysql_num_rows($rep) or chage the SQL statement to SELECT account FROM entries LIMIT 0,1500 coupled with while($row = mysql_fetch_assoc) .... but other than that could u split them into pages..... could just be IE,... thats over 4500 lines of HTML code... shouldn't really matter but u never know

exally is offline   Reply With Quote
Old June 25th, 2008, 01:30 PM     #3 (permalink)
Senior Member
 
bwcc's Avatar
 
Join Date: Nov 2001
Location: Central KS
Posts: 830
SQL doesn't use LIMIT, but thanks.

I did figure out that it is something related to the css style of float:left;

The original code above uses a style sheet that sets the data class as 'float:left;'

Once I remove that (or the css link), it works fine. But to why?????

bwcc is offline   Reply With Quote
Old June 26th, 2008, 04:02 AM     #4 (permalink)
Super F@D Folder
 
Join Date: Jun 2004
Posts: 5,004
Send a message via AIM to sr71000
It sounds to me like the browser is having trouble figuring out where to place everything. Try dropping it to the first 50 records and trying the page. Then what happens?
sr71000 is offline   Reply With Quote
Old June 26th, 2008, 11:06 AM     #5 (permalink)
Senior Member
 
bwcc's Avatar
 
Join Date: Nov 2001
Location: Central KS
Posts: 830
Exactly. I do notice that if the query results in less than 500 records, it renders fine.

I have modified the code to use a table instead and it's working fine now. Yet, it's still a very odd behavior. I did test it on a clean virtual XP machine as well w/ IE 6 and received the same behavior.
bwcc is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may 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
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange behavior... SiliconJon Webmastering and Programming 8 February 8th, 2008 08:43 AM
strange behavior Mombo323 Technical Support 12 January 3rd, 2008 08:49 PM
Strange WMP9 Behavior ciresmis Multimedia and Audio 3 July 3rd, 2004 01:35 AM
Strange Internet Explorer Behavior NeoStarO1 Technical Support 20 February 22nd, 2002 11:06 AM
Strange desktop behavior osprey4 Applications and Operating Systems 8 February 1st, 2002 05:57 AM

Most Active Discussions
Is It Just Me? (535)
Misery Loves Company... (1849)
Why Does the MOON Grow Bigger as It.. (18)
heatsink issue (10)
New Mobo (18)
UPGRADING C/D DRIVE TO 250GB & .. (14)
1 internet. 1 house. 3 computer. ho.. (13)
Is This A Compatible Gaming PC? (18)
SSD's, RAID, and External Backup (7)
Recent Discussions
webcam sharing (0)
help! jumbled text and computer.. (1)
Scanning problem (4)
DFI socket 939 board acting up (5)
Building my first PC and need s.. (2)
32 or 64 bit vista (4)
Big problem with my PC (2)
system restore 'next' button wo.. (2)
firewall (1)
FS: Dell 6000 laptop, modded 36.. (2)
Apple iPod touch 16 GB $200 (4)
Six 28-Disc Cross Design Black .. (4)


All times are GMT -4. The time now is 12:44 PM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28