im tryingto write an iff sttement to check to see if a value is = to or > than a certain value when it is it displays different text but it keeps saying there is an un expected { on line
here my code anway
<h4>Below is a list off all Members</h4>
<body bgcolor="#CCCCCC" text="#000000" link="#000000" vlink="#000000" alink="#000000">
<?php
// Database viewer script for GEA
// (C) Hurst Un-Limited, James Francis Douglas Hurst 2005. All rights reserved.
$server = "localhost";
$username = "*****";
$password = "******";
$pilot_db = "******";
// Open MySQL connection
$mysql = mysql_connect($server,$username,$password);
mysql_select_db($pilot_db,$mysql);
// Get data from table
$result = mysql_query("SELECT * FROM pilotinfo WHERE visible='1'",$mysql);
while($row = mysql_fetch_array($result)) {
$data[] = $row;
}
// Set up the table, put little bits of HTML after the ? > if you want if you want.
?>
<table border=1 cellpadding=2 cellspacing=0><tr><th width="48">ID</th><th>Name</th><th>Flight Hours</th><th>Rank</th></tr>
<?php
// Begin printing data
for($i=0;$i<count($data);$i++) {
$temp1 = $data[$i]['id'];
$temp2 = $data[$i]['name'];
$temp3 = $data[$i]['hour'];
print("<tr><td>EZY- $temp1</td><td>$temp2</td><td>$temp3</td></tr>");
}
########################
#below is the concerning if statment#
########################
if ($temp3 = "0")
{
$val = "0";
$rank = "rank 1";
}
else ($temp3 = "121")
{#<----------------- theres the apparent unexpected {
$val = "121";
$rank = "rank 2";
echo "<td>$val</td>";
print("</table>");
// Add thats all folks!
?>