Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8846383
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T11:58:13+00:00 2026-06-14T11:58:13+00:00

I have a question about a If-statement that is really making me crazy. It

  • 0

I have a question about a If-statement that is really making me crazy.
It seems that I didn’t find a right solution. Please let me explain the situation.
There are 4 possible situations.

  1. Without a film
  2. Without a picture
  3. Without a film but with a picture
  4. without a picture but with a film

A little bit more information but maybe not necessary.
The fields film and pictures are fields in a database. With a PHP script, i’m checking if a field is filled with something. With this information i’m going to build my page. In some case there will be no place for a picture, or for a movie for example. I hope you understand what i’m telling.

This is my code

<?php
    class Artikel{
public function printWholeArticle()
        {
            include ('connection.php');
            $sSql = "SELECT UNIX_TIMESTAMP(datum) as unixDatum, titel, artikel, id, image, video FROM tblArtikels WHERE id = '" . $this->m_sKey."'"; 
            $res = $mysqli -> query($sSql);
            return ($res);
        }
}


$key = $_GET['id']; // I get the key from the url
$oNieuwsArtikel = new Artikel();
$oNieuwsArtikel -> Key = $key;
$vAllNieuwsArtikel = $oNieuwsArtikel -> printWholeArticle();

$artikel = $vAllNieuwsArtikel -> fetch_assoc();


// just a part of my if statement, to let you guys know how I print the data to the screen
if ($artikel['image'] == "")
            {
                echo "<div class='datum'>" . "<div class='day'>" . date('d', $artikel['unixDatum']) . "</div>" . "<div class='month'>" . "/" . date('m',                            $artikel['unixDatum']) . "</div>" . "<div class='year'>" . date('Y', $artikel['unixDatum']) . "</div>" . "</div>";
            echo "<p>" . "<div class='content_wrap_page'>" .  "<div class='artikel_page'>" 
            . "<h1>" . $artikel['titel'] ."</h1>" . $artikel['artikel'] . "</div>" . "</div>" . "</p>";
            }

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T11:58:14+00:00Added an answer on June 14, 2026 at 11:58 am
    if (empty($artikel['video']))
    {
        // no film code
    
        if (!empty($artikel['image']))
        {
            // no film but with picture code
        }
    }
    else if (empty($artikel['image']))
    {
        // no picture code
    
        if (!empty($artikel['video']))
        {
            // no picture but with film code
        }
    }
    

    Where $film and $picture are set to the value retrieved from the database query.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay, so I have a question about using columns in a case statement that
I have a question about using subqueries in an Update statement. My example: UPDATE
Hi I have a question about ruby on rails Apparently I have a statement
I have question about parsing in Html helper : I have sth like: @foreach
I have question about clean thory in Python. When: @decorator_func def func(bla, alba): pass
I have question about XSLT1.0. The task is to write out in HTML all
I have question about normalization. Suppose I have an applications dealing with songs. First
I have question about interpreting strings as packed binary data in C++. In python,
i have question about YAJLiOS parser... I have next json data : {{ body
I have a question about this formula from a book: EFW (cm,kg)= 10^(-1,7492+(0,166*BPD)+(0,046*AC)-(2,646*AC*BPD/1000)) The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.