Jump to content

really simple daft question


wmguk

Recommended Posts

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

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'];

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.