If/Else/Then statement in PHP/Mysql

Ok, so I have a current setup that says


if ($row['a'] == 'value1') {$variable = 'URL value1'}
elseif ($row['a'] =='value2'){$variable= 'URL value2'}
elseif ($row['a'] =='value3'){$variable= 'URL value3'}
elseif ($row['a'] =='value4'){$variable= 'URL value4'}
elseif ($row['a'] =='value5'){$variable= 'URL value5'}

I need to add into this saying



if ($row['b'] == 'y') {

if ($row['a'] == 'value1') {$variable = 'URL value1'}
elseif ($row['a'] =='value2'){$variable= 'URL value2'}
elseif ($row['a'] =='value3'){$variable= 'URL value3'}
elseif ($row['a'] =='value4'){$variable= 'URL value4'}
elseif ($row['a'] =='value5'){$variable= 'URL value5'}
}

if ($row['b'] == ' ') {

if ($row['a'] == 'value1') {$variable = 'URL value1a'}
elseif ($row['a'] =='value2'){$variable= 'URL value2a'}
elseif ($row['a'] =='value3'){$variable= 'URL value3a'}
elseif ($row['a'] =='value4'){$variable= 'URL value4a'}
elseif ($row['a'] =='value5'){$variable= 'URL value5a'}
}


so in essence I want to look at row b if it is = y then I want it to look at row a and provide a url based on row a

if row b is blank then I want to look at row a and provide a different URL, I hope this makes sense.

Karchion

if($row['b'] == 'y') {
  $variable = "URL ".$row['a'];
} else {
  $variable = "URL ".$row['a']."a";
}

I’m guessing my example did not work out so well… What I am looking for is I have two if statements that need to be combined…

So lets try this way… I have a report that needs to be digitally signed, I have two jpegs that will be used. Jpeg 1 (unsigned) and Jpeg 2 (signed).

the only time it is to be signed is when the person who created the report reviews the report and says that no changes need to be made. Hence the first if statement

$row[‘b’] is wether or not the report is signed or not. the second if statment is taking the user who created the report and creating a link to the jpeg that needs to be put there.

So all together we have

if $row[‘b’] == ‘y’ ****then find jpeg 2 for user *****

if $row[‘a’] == ‘user1’ { user1jpeg2.jpeg}
elseif $row[‘a’] == ‘user2’ { user2jpeg2.jpeg}
and so on…

but if $row[‘b’] == ’ ’ ****then find jpeg 1 for user *****

if $row[a] == ‘user1’ {user1jpeg1.jpeg}
elseif $row[a] == ‘user2’ {user2jpeg1.jpeg}

and so on…

I hope this helps clarify