I´m new to SQL and PHP, and need assistance for below problem.
i have an SQL database, with , for example, "username, password, nationality, class", what i want to do is, a simple PHP or SQL query that will check the user's class field from database and display corresponding URL in a designated iFrame (for example, classes are J1, J2, J3, if the field already contains J3 then upon load display a corresponding URL for that, without any user input. (all will be decided in advance)
You can think of it as a student profile, once the student has successfully logged, the query will read the class field and according to what it finds, it will return a click-able URL with the correct link.
This is way too difficult for the level i am right now, hope someone can shed a bit of light on me.
this is the code after the user is successfully logged in.
<!-- NOTIFICATIONS STARTS HERE -->
<?php
require_once('connection.php');
$id=$_SESSION['SESS_MEMBER_ID'];
$result3 = mysql_query("SELECT * FROM member where mem_id='$id'");
while($row3 = mysql_fetch_array($result3))
{
$fname=$row3['fname'];
$country=$row3['country'];
$class=$row3['class'];
$headteacher=$row3['headteacher'];
$attendance=$row3['attendance'];
$homework=$row3['homework'];
$messageparents=$row3['messagestudent'];
}
?>
<table width="468" border="0" align="center" cellpadding="0">
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS">
<table width="468" border="0" align="center" cellpadding="0">
<tr>
<td class="FONTS"><div align="left" class="FONTS"><b>名前:</b></div>
<?php echo $fname ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>国:</b></div>
<?php echo $country ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>クラス:</b></div>
<?php echo $class ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>家庭教師の先生:</b></div>
<?php echo $headteacher ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>出席率:</b></div>
<?php echo $attendance ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>宿題率:</b></div>
<?php echo $homework ?></td>
</tr>
<tr class="FONTS">
<td valign="top"><div align="left" class="FONTS"><b>先生からメッセージ:</b>
</div>
<?php echo $messagestudent ?></td>
</tr>
</table>
</div></td>
</tr>
</table>
<p align="center" class="FONTS"><a href="index.php">ログアウト</a></p>
<!-- NOTIFICATIONS ENDS HERE -->
it is already working as intended so i will not be changing it unless its completely necessary, i just need to be able to display that URL link.
thanks in advance!