Hi
The code below is a part of school site where parents get their kids grades. Recently I noticed that on some computers, the grade list is empty as if there is a connection problem with the database. On the same PC, Firefox has no issues, while IE has the problem mentioned. At my home PC, I have no problem wiht IE or Chrome showing the results!
I would appreciate if someone could help me understand why browsers are coming up with different results.
thanks in advance.
$user =& JFactory::getUser();
$session =& JFactory::getSession();
$session->set(‘username’, $user->get(‘username’));
$session =& JFactory::getSession();
mysql_connect (“SERVER” , “LOGIN” , “PASSWORD” ) or die(mysql_error());
mysql_select_db(“joomla_joomla”) or die(mysql_error());
$mytest = mysql_query(“select students.fname, students.lname, students.logname, students.year from students where students.logname = ‘”.$session->get(‘username’).”‘;” )
or die(mysql_error());
echo “Results<br><br>”;
while($info1 = mysql_fetch_array( $mytest ))
{
print “<tr>Student: <td> “.$info1[‘fname’].” </td> <td>”.$info1[‘lname’] .” </td> — Grade <td>”.$info1[‘year’] .” </td></tr>”;
}
?>
<br><br>
</center></b>
<table align=”center”>
<?php
//connect to db
mysql_connect (“SERVER” , “LOGIN” , “PASSWORD” ) or die(mysql_error());
mysql_select_db(“joomla_joomla”) or die(mysql_error());
//SET NAMES ‘utf8’;
//collect data
$data = mysql_query(“select grades.term, grades.subject, grades.grade, students.fname, students.lname, students.logname, students.st_id, grades.st_id from grades, students where students.st_id=grades.st_id and grades.term=’1′ and students.logname = ‘”.$session->get(‘username’).”‘;” )
or die(mysql_error());
Print “<table border cellpadding=5>”;
print “<th bgcolor=#B6BA18><font size=’3′>Grade</th>”;
print “<th bgcolor=#B6BA18><font size=’3′>Subject</th>”;
echo “$info[fname]”;
while($info = mysql_fetch_array( $data ))
{
print “<tr>”;
print “<tr><td div align=center width=”135″ height=”2”><font size=’2′> “.$info[‘grade’].” </td></font> <td div align=right><font size=’2′>”.$info[‘subject’] .” </td></font></tr>”;
}
Print “</table>”
?>
</table>
</p>
</blockquote>
</blockquote>
</blockquote>
</blockquote>