I'm trying to write an if else statement dependent on the value of a mySQL field.
Basically, in the awards table, if the id_project is PRJ000 then I want the $tempID and $tempProjectName to be different values.
Right now this code runs but the results on the page are all following the "else" code block, which makes me think I've set up the "if" wrong. Any advice?
<?PHP
$query = "SELECT * FROM `awards` ";
$query .= "WHERE `active` = '1' ";
$query .= "ORDER BY `date` DESC ";
$query .= "LIMIT $idStart, 10 ";
$result = mysql_query($query);
while($row = mysql_fetch_array($result)){
$query2 = "SELECT * FROM `projects` ";
$query2 .= "WHERE `id_fm` = '".$row["id_project"]."' AND `active` = '1' ";
$result2 = mysql_query($query2);
while($row2 = mysql_fetch_array($result2)){
if($row["id_project"] == "PRJ000"){
$tempID = "#";
$tempProjectName = "General";
}
else {
$tempID = $row2["id_x"];
$tempProjectName = $row2["title"];
}
}
?>
$row["id_project"]?$row["id_project"]has at each iteration?