jeff5656 Posted February 2, 2009 Share Posted February 2, 2009 Ok look at these two links. Here everything lines up: http://www.hfhpulm.com/schedules/staffcallnext.php however here the date does not line up in the table: http://www.hfhpulm.com/schedules/staffcallcurrent.php Now the WEIRD thing is that the two codes are EXACTLY the same except: link 1: <?php $next_month= date("F", strtotime("+1 month")); $curr_month = date ('F'); $consultsq1 = "SELECT * FROM `staffsched` WHERE `which_month`='".$next_month."'"; link 2 (the one that doesn't line up): $next_month= date("F", strtotime("+1 month")); $curr_month = date ('F'); $consultsq1 = "SELECT * FROM `staffsched` WHERE `which_month`='".$curr_month."'"; Why would changing to the current month (which also happens to be the value on the database) make the lines not match up? To make it weirder, both links line up correctly if viewed in firefox!! Whoever can figure this out is literally a genius. Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/ Share on other sites More sharing options...
uniflare Posted February 2, 2009 Share Posted February 2, 2009 $consultsq1 = "SELECT * FROM `staffsched` WHERE `which_month`='".$curr_month."'"; I believe its the order mysql is matching those rows. use ORDER BY, for which_month; $consultsq1 = "SELECT * FROM `staffsched` WHERE `which_month`='".$curr_month."' ORDER BY `which_month` DESC"; hope this helps, Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752901 Share on other sites More sharing options...
rhodesa Posted February 2, 2009 Share Posted February 2, 2009 um...why do you have so many nested tables...all that data should be in 1 table Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752902 Share on other sites More sharing options...
rhodesa Posted February 2, 2009 Share Posted February 2, 2009 loading up the source...you have all sorts of HTML problems. Here is the first table: <table width="80%"> <td> <a href="../index.html"> <img src="../images/hfh logo.jpg" alt="Division - Home" width="80" height="50" border="0" /> </a> </td> <td align="center" <div align='center'> <h1> February Call Schedule</h1> </div> </td> <td align="right" valign="bottom"> <a href="http://pulm/consults/displaystaff.php"> <h3> STAFF CONTACT NUMBERS</h3> </a> </td> </table> there are all sorts of html errors in there if you can get it to validate, i bet your problems would go away: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.hfhpulm.com%2Fschedules%2Fstaffcallcurrent.php&charset=(detect+automatically)&doctype=Inline&group=0 Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752908 Share on other sites More sharing options...
jeff5656 Posted February 2, 2009 Author Share Posted February 2, 2009 "um...why do you have so many nested tables...all that data should be in 1 table " It is horrible code I realize and the database was setup before I bothered learning about relational databases so the php code and the database table is really really bad. I actually started that in Word and "saved as" a web page then brought it into Dreamweaver. It is so complex that I one day will re-do it correctly. It's on my list of things... :-) "I believe its the order mysql is matching those rows. use ORDER BY, for which_month;" Nope that didn't work. :-) Like I said, if you figure this out you're a genius! Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752911 Share on other sites More sharing options...
jeff5656 Posted February 2, 2009 Author Share Posted February 2, 2009 "loading up the source...you have all sorts of HTML problems. Here is the first table:" Yes but that SAME code is there for the first link that DOES correctly line up! The ONLY difference is that the "incorrect" link echo's the record that has the which_month value equaling the current month, and the other link has the $which_month value equaling next month. That is the only difference in the entire code. (and it works in FF). BTW, there are lots of nested tables so that it displays all the way down instead of going across (i.e. all the dates get displayed first going down then the table ends and the next <td> goes across with another table nested in *that* cell). Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752913 Share on other sites More sharing options...
MatthewJ Posted February 2, 2009 Share Posted February 2, 2009 IE and FF have many subtle differences in they way they display output. I agree that you should bite the bullet and clean up the html now... It will probably fix the problem you're having, or at least make it easier to find. Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752925 Share on other sites More sharing options...
Snart Posted February 2, 2009 Share Posted February 2, 2009 The problem comes from the fact that you use nested tables and that both browsers use different font sizes. Names like "El-Sayed" are shown on one line in FF but on two lines in IE: El-Sayed versus El- Sayed This causes your table to enlarge vertically. In a signle table, all cells in that row would enlarge along with it, but this doesn't happen now. You might want to reduce font size a bit and you definitely need to redesign the table structure. Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752931 Share on other sites More sharing options...
jeff5656 Posted February 2, 2009 Author Share Posted February 2, 2009 "In a signle table, all cells in that row would enlarge along with it" Well, without nested tables, how do I display all the 31 dates in the first column and then have the second column start back at row 1? Here's the php code behind the first 2 columnns of the table: echo "<tr><td ><table >"; $varArray = array("which_date"); $varArraySize = count($varArray); for ($i = 0; $i < $varArraySize;$i++) { for ($f = 1; $f < 32; $f++) { echo "<td style='border-bottom-style: solid;'> " . $row[$varArray[$i] . $f] . "</td>"; echo "<tr>"; } } echo "</table></td>"; echo "<td valign='top' width='20' align='center'><table>"; $varArray = array("icufellow"); $varArraySize = count($varArray); for ($i = 0; $i < $varArraySize;$i++) { for ($f = 1; $f < 32; $f++) { echo "<td style='border-bottom-style: solid;'> " . $row[$varArray[$i] . $f] . "</td>"; echo "<tr>"; } } echo "</table></td>"; Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752963 Share on other sites More sharing options...
Snart Posted February 2, 2009 Share Posted February 2, 2009 It might be easier to compile all the source data into one array: $x = array ( '1' => array('ICU Fellow', 'F2 Staff', 'Intervention'), '2' => array('ICU Fellow', 'F2 Staff', 'Intervention'), ... '31' => array('ICU Fellow', 'F2 Staff', 'Intervention'), ) Then simply go foreach($x as $key => $val){} to build up the table. Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752977 Share on other sites More sharing options...
gevans Posted February 2, 2009 Share Posted February 2, 2009 The php isn't the problem here, it's yout HTML loading up the source...you have all sorts of HTML problems. Here is the first table: <table width="80%"> <td> <a href="../index.html"> <img src="../images/hfh logo.jpg" alt="Division - Home" width="80" height="50" border="0" /> </a> </td> <td align="center" <div align='center'> <h1> February Call Schedule</h1> </div> </td> <td align="right" valign="bottom"> <a href="http://pulm/consults/displaystaff.php"> <h3> STAFF CONTACT NUMBERS</h3> </a> </td> </table> there are all sorts of html errors in there if you can get it to validate, i bet your problems would go away: http://validator.w3.org/check?uri=http%3A%2F%2Fwww.hfhpulm.com%2Fschedules%2Fstaffcallcurrent.php&charset=(detect+automatically)&doctype=Inline&group=0 Listen to that and you will be fine Quote Link to comment https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/#findComment-752979 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.