close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

else and elseif statement

Thread began 2/02/2023 5:38 pm by jo271221 | Last modified 2/04/2023 2:15 pm by Ray Borduin | 87 views | 1 replies |

jo271221

else and elseif statement

The PHP manual shows ?php only once

<?php
if ($a > $b) {
echo "a is bigger than b";
} elseif ($a == $b) {
echo "a is equal to b";
} else {
echo "a is smaller than b";
}
?>


My rules look more like this - simple working show if
<?php
if ($WADAtable->getColumnVal('sire') != '') {
?>
show content here
<?php
}
?>


1) Does the php get repeated?
2) What is the proper format to reference the table and column name

Attempt at show if else which is not even a good attempt.....

<?php
if ($WADAtable>getColumnVal("column1") == '') {
?>
1
<?php
} elseif {.$WADAtable->getColumnVal("column2") == ''
?>
2
<?php
} else { thisrequirement2
?>
3
<?php
}
?>

Sign in to reply to this post

Ray BorduinWebAssist

By adding the extra <?php and ?> you can write content to the page without using echo()

That allows it to be displayed in Dreamweaver design view as well, so I prefer that syntax.

I'm not sure what you are going for with the line:

php:
<?php

} elseif {.$WADAtable->getColumnVal("column2") == ''
?>



elseif syntax is exactly the same as if syntax... just it won't run if the code above did. So yours should look more like:

php:
<?php

} elseif ($WADAtable->getColumnVal("column2") == '') {.
?>



and this :

php:
<?php

} else { thisrequirement2
?>



should be:

php:
<?php

} else (thisrequirement2) {
?>
Sign in to reply to this post
Did this help? Tips are appreciated...

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...