If Statement in query

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
webdzine
Forum Newbie
Posts: 20
Joined: Wed Dec 08, 2010 12:40 am

If Statement in query

Post 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)";
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: If Statement in query

Post by Celauran »

webdzine wrote:i need to have the following entry equal "$phone"
Replace 'echo' with '$phone ='
webdzine
Forum Newbie
Posts: 20
Joined: Wed Dec 08, 2010 12:40 am

Re: If Statement in query

Post by webdzine »

thank you
Post Reply