Skipjackrick Posted January 22, 2010 Share Posted January 22, 2010 Is there something wrong here? I can't figure this out. Looks perfectly normal to me? <?php if ( $results['team_id'] == 0 ) { $team .= 'Not Specified'; } else { $queryteam = "SELECT * FROM team WHERE team_id={$results['team_id']} "; $result = mysql_query($queryteam) or die(mysql_error()); $team = mysql_fetch_assoc($result) } ?> Quote Link to comment Share on other sites More sharing options...
iPixel Posted January 22, 2010 Share Posted January 22, 2010 This part is iffy $team .= 'Not Specified'; You're appending values to the $team variable by using .= but in the else statement you are not. Which leads me to believe you need $team = ""; somewhere above that code. Do You? Quote Link to comment Share on other sites More sharing options...
Skipjackrick Posted January 22, 2010 Author Share Posted January 22, 2010 This part is iffy $team .= 'Not Specified'; You're appending values to the $team variable by using .= but in the else statement you are not. Which leads me to believe you need $team = ""; somewhere above that code. Do You? No, I am not using that above.... I see what you mean. Quote Link to comment Share on other sites More sharing options...
Skipjackrick Posted January 22, 2010 Author Share Posted January 22, 2010 Here is my output when the if statement is true echo "$team"; is displayed like this N Quote Link to comment Share on other sites More sharing options...
Skipjackrick Posted January 22, 2010 Author Share Posted January 22, 2010 Dang, I found it...too quick to post..... However, I am thankful that you noticed my appending variable.. I didn't mean to do that. The answer.... I was missing a semicolon below..... $team = mysql_fetch_assoc($result) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.