Hi there.
I am trying to build an IF statement that will control the value of a variable (that will be part of a url that will be added later in a script) based on the value returned in a SQL statement.
The way I thought it would work is:
First set the variables:
The statement being (where the value of 'gallery', returned by SQL, is either 'art' or something else):
Unfortunately, the $page variable does not change. It returns the value of $v1 regardless of the value of $gallery.
I am sure there is a minor tweak needed but my brain is tired!! Please could you offer any advice?
Many thanks.
I am trying to build an IF statement that will control the value of a variable (that will be part of a url that will be added later in a script) based on the value returned in a SQL statement.
The way I thought it would work is:
First set the variables:
Code:
$v1='product';
$v2='photoproduct';
The statement being (where the value of 'gallery', returned by SQL, is either 'art' or something else):
Code:
if ($gallery == 'ART')
{
$PAGE=$v1;
}
else
{
$PAGE=$v2;
}
I am sure there is a minor tweak needed but my brain is tired!! Please could you offer any advice?
Many thanks.