Right, I have this code:
PHP code:
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{ $prefixweb = "./nmr/{$row['machine']}/{$row['year']}/{$row['month']}/data/AB/nmr/{$row['servercode']}/";
$prefixuni = "file:///N:/vol3/users/snmrdata/{$row['machine']}/{$row['year']}/{$row['month']}/data/AB/nmr/{$row['servercode']}/";
echo " STUFF ";
}
I want to make it so when "machine" ({$row['machine']}) is a certain specific value, the value being "varian", the directory structures of $prefixweb and $prefixuni change.
If I'm thinking right I need to use an if else statement.
I've tried and failed as usual, hence the post.
I've concentrated on only one of the directory structures, $prefixuni, since that's the one I use the most.
So yeah, I've got this:
PHP code:
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{$prefixweb = "./nmr/{$row['machine']}/{$row['year']}/{$row['month']}/data/AB/nmr/{$row['servercode']}/";
if ($row['machine']=="varian")
{
$prefixuni = "file:///N:/vol3/users/snmrdata/{$row['year']}/service/{$row['month']}/4_StuYEAR/{$row['servercode']}/"
else
$prefixuni = "file:///N:/vol3/users/snmrdata/{$row['machine']}/{$row['year']}/{$row['month']}/data/AB/nmr/{$row['servercode']}";
}
echo " STUFF ";
}
It don't work, why?
:C
Also, can you have it try for a few different specifics then to go to a default?
As in
If A then 1 or
if B then 2 or
if C then 3
else 4