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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T09:31:01+00:00 2026-06-06T09:31:01+00:00

I have a little temperature protocoling web app, where degrees get adjusted on a

  • 0

I have a little temperature protocoling web app, where degrees get adjusted on a page and saved in a database.

It works, but sometimes sporadic errors occur from users which I can’t reproduce!

Sometimes there are null-entries in the database and I don’t know how and why. It “nulls” the hole row (several temperatures per day are selectable).

If e.g. no temp got selected in a div string “NA” should be handed to the db. This bug is so resilient, I don’t know where else to turn to.

Ajax increases Values by clicking on Arrow

$(".arrow_up").die('click');        
$(".arrow_up").live('click',function() {
    var value = $("#temp_"+this.id).html();
    if (value=="NA") {value=$("#istemp_"+this.id).html()}
            var newValue = parseInt(value)+ 1;

hands Values over to server

$(document).ready(function() {
$('#save').die('click');                       
$("#save").live('click',function() {
    var tempA=$("#temp_itemA").html();
    var tempB=$("#temp_itemB").html();          

PHP has to store it

I look if it isn’t empty nor that the string null gets handed over. Last one throws Error.

<?php
    if((!isset($_GET['tempA'])) || (!isset($_GET['tempB'])) || ($_GET['tempA']!='null')
      {
        echo "values are missing";
      }
    else 
    {
    error_reporting(E_ALL);
    try {
        $dbh = new PDO('sqlite:/var/www/xxx.sqlite');
        $dbh->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);  

    $date=date("Y-m-d",time());
    $sql = "SELECT * FROM tableTemp WHERE date='".$date."'";    
    $result = $dbh->query($sql);
    foreach($result as $row) {
        $id = $row['id'];
    }

    if (!empty($id)) {
        $sql = "UPDATE tableTemp SET tempA='".$_GET['tempA']."',tempB='".$_GET['tempB']"'";
        $result = $dbh->query($sql);
    }

    else {
        $sql = "INSERT INTO tableTemp ('tempA','tempB')";
        $result = $dbh->query($sql)
?>

I mean, this is as simple as it gets. I can only imagine the trasmitting errors might have something to do with WIFI and packet loss.

How can I can stop inserting (discarding) these pesky null string into the db and throw an error, so that the user has to try it again? My !isset does not work since it isn’t empty

  • 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-06T09:31:02+00:00Added an answer on June 6, 2026 at 9:31 am

    Note this is probably stating the obvious

    But can you not stipulate that the column in the DB requires a value that is not null then catch the error on the insert

    have you seen this answer?

    https://stackoverflow.com/a/2103256/1479565

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

Sidebar

Related Questions

I have little bit longer question for you - but hope answer will be
I have little question about how web browser retrieve webpage? I know this User
I have little doubt, I have a field of type oid in my database
I have a MainMenu in my app and I would like to have little
i have little problem in using my application application having msaccess database if i
I have little JAVA coding experience (some classes at university) but none in the
I have little impression about variables resolve order, but I can't find it in
I have little experience with silverlight development still but with the potential of silverlight
I have little Silverlight app that needs to make queries to server, is it
I have little problem. I can't use AcceptVerb.Get on some ASP.NET MVC actions because

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.