Page 1 of 1

If Statement in query

Posted: Mon Jan 23, 2012 2:29 pm
by webdzine
is there any possible way to get an if statement in a query?
i need to have the following entry equal "$phone"

Code: Select all

if (isset($result)) {
echo $rowsel['phonenumber']; }
else if (isset($results)) {
echo $rowsels['default_phone_number']; }
else {
echo $rowselss['entry']; };
basically
$phone = "(CODE)";

Re: If Statement in query

Posted: Mon Jan 23, 2012 2:37 pm
by Celauran
webdzine wrote:i need to have the following entry equal "$phone"
Replace 'echo' with '$phone ='

Re: If Statement in query

Posted: Mon Jan 23, 2012 3:27 pm
by webdzine
thank you