Help with if staement
Posted: Sat Apr 04, 2009 6:58 pm
Hello,
I have a field in a MySQL table that defaults to "empty" unless it's written over. I'm using the following code to assign a variable based on what's written in that MySQL field.
However, it doesn't seem to recognize the if statement and defaults to else part of the if statement regardless of what actually in the filed. Any ideas?
Thanks,
Gary
I have a field in a MySQL table that defaults to "empty" unless it's written over. I'm using the following code to assign a variable based on what's written in that MySQL field.
Code: Select all
$query2 = "SELECT * FROM $table";
$row = mysql_fetch_assoc(mysql_query($query2));
if ($row['name'] == 'empty') { $joblink = "no download"; } else { $joblink = "download"; };
Thanks,
Gary