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 6723891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T09:37:23+00:00 2026-05-26T09:37:23+00:00

I have an issue with an script I have been running. When the query

  • 0

I have an issue with an script I have been running.

When the query has been run the field datum_betalen stays empty. What have I done wrong? If I echo $datum_betalen after executing the query it has an date.

//zoek aantal dagen bij betalingstermijn
if($bet_term_maand == 'ja')
{
    $aantal_maanden = ceil($bet_term_dagen / 30);
    $dagen_resterend = date('t') - date('d') - 1;
    $datum_betalen = mktime(0, 0, 0, date('m') + $aantal_maanden  , date('d') + $dagen_resterend, date('Y'));
    $datum_betalen = date('m-d-Y', $datum_betalen);
}
else
{
    $datum_betalen = mktime(0, 0, 0, date('m'), date('d') + $bet_term_dagen, date('Y'));
    $datum_betalen = date('m-d-Y', $datum_betalen);
}

// voer query uit
if($land_id == 1)
{
    $btw = $config['btw'];
}
else
{
    $btw = 0;
}

if($type == 'factuur')
{
    $sql = "INSERT INTO 9_factuur_id
        (
            dossier_id,
            factuur_nr,
            contact_id,
            naam,
            btw,
            min_orderkosten,
            transport,
            datum_verstuurd,
            bet_term_dagen,
            bet_term_maand,
            datum_betalen,
            soort,
            status,
            user_id
        )
        VALUES
        (
            '".$dossier_id."',
            IFNULL((SELECT MAX(factuur_nr) + 1 FROM 9_factuur_id AS temp),'42003'),
            '".$contact_id."',
            '".$naam."',
            '".$btw."',
            '".$min_orderkosten."',
            '".$transport."',
            NOW(),
            '".$bet_term_dagen."',
            '".$bet_term_maand."',
            '".$datum_betalen."',
            'factuur',
            'open',
            '".$_SESSION['user_id']."'
        )
    ";
}
else
{
    $sql = "INSERT INTO 9_factuur_id
        (
            dossier_id,
            contact_id,
            naam,
            btw,
            min_orderkosten,
            transport,
            datum_verstuurd,
            bet_term_dagen,
            bet_term_maand,
            datum_betalen,
            soort,
            status,
            user_id
        )
        VALUES
        (
            '".$dossier_id."',
            '".$contact_id."',
            '".$naam."',
            '".$btw."',
            '".$min_orderkosten."',
            '".$transport."',
            NOW(),
            '".$bet_term_dagen."',
            '".$bet_term_maand."',
            '".$datum_betalen."',
            'proforma',
            'open',
            '".$_SESSION['user_id']."'
        )
    ";
}

Any ideas?

  • 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-05-26T09:37:24+00:00Added an answer on May 26, 2026 at 9:37 am

    If datum_betalen is of type date, you should change your date format to Y-m-d as this is used in MySQL. Also I would recommend avoiding code duplication; for example on:

    $datum_betalen = date('m-d-Y', $datum_betalen);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some issue with a Perl script. It modifies the content of a
I have a script that somebody from SO kindly provided to solve an issue
I am having an annoying issue. I have a script which uses the $_GET
We have an issue related to a Java application running under a (rather old)
I have an issue with using AWK to simply remove a field from a
I have been running an MSDEPLOY command successfully for the past couple weeks until
I have done quite a bit of research on this issue and have not
I have been trying to get slimv (http://www.vim.org/scripts/script.php?script_id=2531) working for a while now, but
I had an issue with DBMS_SCHEDULER in oracle.I have an external programme(a perl script
I have multiple virtual hosts running PHP 5.2.17. Periodically a script will seemingly randomly

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.