Jump to content

Recommended Posts

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.

Link to comment
https://forums.phpfreaks.com/topic/143523-very-weird-problem-in-ie-only/
Share on other sites

$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,

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

"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!

"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).

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.

"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>";

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.

 

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.