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... Link to comment https://forums.phpfreaks.com/topic/95433-really-simple-daft-question/ 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']; Link to comment https://forums.phpfreaks.com/topic/95433-really-simple-daft-question/#findComment-488565 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! Link to comment https://forums.phpfreaks.com/topic/95433-really-simple-daft-question/#findComment-488602 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.