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

  • SEARCH
  • Home
  • 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 9257115
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T12:07:16+00:00 2026-06-18T12:07:16+00:00

I am working in a sensors project where many sensors outputs data which are

  • 0

I am working in a sensors project where many sensors outputs data which are stored in mysql table. I am using highcharts to visualize those data.

My problem is when I use the live mode, with an ajax call every second to my database, some data are not displayed since the ajax call fetch only the latest one and some points are dropped default of synchronization between the time when I push the data from sensors and the time to fetch them with ajax. I tried to synchronize this manually but I failed .

I am asking if there is a parameter that I can add to my sql queries to fetch only the data which has not been read yet, like this even if I push 3 data in one second with an ajax call made in on second I get only the not read data not the latest one.

I don’t know if this solution really exist and I am pretty new in php and mysql and I use them for research purpose only ,I need the simplest and the minimum solution !!

EDITI:: create new table last_point with last_point_id and last_point_info

I am using yii framework, I couldn’t make an update query using yii library
so I used this code

$modelSensor = SensorInfo2::model()->findBySql('SELECT * FROM information_sensors  
         where sensors_id= "'.$s['sensors_id'].'"  ; ');    


   $sResult = array(intval($modelSensor->information_time ),intval($modelSensor-

                                                        >information_value ));

        foreach ($modelSensor as $up) // for each value that I get from previous query 
                                       //   I want to use it to  
                                        //    update  last_point table

          {

        $connection = yii::app()->db;

         $sql = 'UPDATE last_point  SET last_point_info = 
         "'.$up['information_time'].'"' ;

         $command=$connection->createCommand($sql);
         $command->execute();


         }

        $json = CJSON::encode($sResult);

            echo $json ;

            Yii::app()->end(); 

for my ajax query not problem and I still get my data, but the row last_point_info in the other table change to zero !
Any idea ? how the two tables should be connected ?

Many thanks in advance

  • 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-18T12:07:17+00:00Added an answer on June 18, 2026 at 12:07 pm

    I used 2 cdbcreteria one for geting the condition and another to get mydata using the first cdbcreteria as condition here

    and finaly I update the time in the other table with foreach statement with this code

    foreach ($sensors as $sensor)  {
     $lastPointId = 1;  
     $lastPoint = LastPoint::model()->findByPk($lastPointId);
     $lastPoint->last_point_info = $sensor->information_time;
     if ( ! $lastPoint->save()) {
    throw new CException('Unable to save last point.');
    }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm working on a car simulation project in Blender using python scripting. So far,
I am working on a traffic surveillance project which performs various image processing tasks
Hey Guys I am currently working on a project which will access the accelerometer
I am currently doing some research which involves analyzing data coming from different sensors.
I'm working on proof of concept project. That is using a UITableView to display
I'm working on a modular project consisting of multiple sensors, each inheriting from an
I am working on a project which includes an Android application which is used
I'm planning to setup some sensors for a project I am working on. I
I am working on a project which needs me to configure the gpio pins
I'm working on developing an application that talks to a family of USB sensors.

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.