A little help writing an IF statement


#1

I never was really good with the statements.
Could you tell me what im doin wrong here…

As to not confuse any one. photourl = the file name of the picture
[php]

<?php include "conn.inc.php"; $path = "photos/"; $query = mysql_query("SELECT photourl FROM user_info WHERE city = '".$_GET["city"]."' AND state = '".$_GET["state"]."'"); $result = mysql_fetch_array($query); $image = $result['photourl']; ?> <?php $query = mysql_query("SELECT photo FROM user_info WHERE city= '".$_GET["city"]."' AND state = '".$_GET["state"]."'"); $resultT = mysql_fetch_array($query); if ($resultT=1) { echo ""; }else{ echo ""; } ?>

[/php]


#2

Problem solved :)

I Changed parts marked in red


ORIGINAL

<?php $query = mysql_query("SELECT photo FROM user_info WHERE city= '".$_GET["city"]."' AND state = '".$_GET["state"]."'"); $resultT = mysql_fetch_array($query); if ($resultT=1) { echo ""; }else{ echo ""; } ?>

EDITED

<?php $query = mysql_query("SELECT photo FROM user_info WHERE city= '".$_GET["city"]."' AND state = '".$_GET["state"]."'"); $resultT = mysql_fetch_array($query); $yyy = $result['photo']; if ($yyy=1) { echo ""; }else{ echo ""; } ?>

#3

if ($yyy=1) { Will ALWAYS evaluate to TRUE. You have used the ASSIGNMENT operator of equals when you want to use the EVALUATION operator of equals equals.

if ($yyy==1) {