wmguk Posted March 10, 2008 Share Posted March 10, 2008 hey guys, I am using this code $result = mysql_query("SELECT * FROM album WHERE login = '$login'"); while($row = mysql_fetch_array($result)) { $groom_firstname = $row['groom_firstname']; $ceremony = $row['ceremony']; if ($groom_firstname == 'X') { echo "The " . $row['ceremony'] . " of " . $row['bride_firstname']; } else { echo "The " . $row['ceremony'] . " of " . $row['bride_firstname'] . " " . $row['bride_surname'] . " and " . $row['groom_firstname'] . " " . $row['groom_surname']; } } which works, but how can i say that $albumname = the output of the result? basically I want to assign $albumname to whatever is displayed... Quote Link to comment Share on other sites More sharing options...
revraz Posted March 10, 2008 Share Posted March 10, 2008 Assign the variable after the echo..ie $albumname = "The " . $row['ceremony'] . " of " . $row['bride_firstname']; $albumname = "The " . $row['ceremony'] . " of " . $row['bride_firstname'] . " " . $row['bride_surname'] . " and " . $row['groom_firstname'] . " " . $row['groom_surname']; Quote Link to comment Share on other sites More sharing options...
wmguk Posted March 10, 2008 Author Share Posted March 10, 2008 Excellent thank you !!! So simple, yet i just couldnt see it! 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.