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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:39:39+00:00 2026-06-13T07:39:39+00:00

I am getting 0(zero) values for the variables that were sent from the Javascript

  • 0

I am getting 0(zero) values for the variables that were sent from the Javascript

$query= "SELECT Name,Lastname FROM %s s, %s v, %s k WHERE s.FK_ID_user=%d AND s.Reg_id=%d AND s.Reg_id=k.Reg_id
     AND v.ID_user= s.FK_ID_user AND DATE(s.Time) BETWEEN '%d-%d-%d' AND '%d-%d-%d'";
$query = sprintf($query,$_SESSION['SESS_MAIN_BASE'],$_SESSION['SESS_USER_BASE'],$_SESSION['SESS_REG_BASE'],$id_user,$reg_id,$d_year1 ,$d_month1,$d_day1,$d_year2,$d_month2,$d_day2);

From Javascript:

$.ajax({
                  type: 'POST',
                  url: 'history.php',
                  data: {
                  'id_user':$('#select-choice-user').val(),
                  'reg_id':$('#select-choice-reg').val(),
                  'd_year1':$('#select-choice-year1').val(),
                  'd_month1':   $('#select-choice-month1').val(),
                  'd_day1':$('#select-choice-day1').val(),
                  'd_year2':$('#select-choice-year2').val(),
                  'd_month2':   $('#select-choice-month2').val(),
                  'd_day2':$('#select-choice-day2').val()
                  },
                  success: function(data)//callback to be executed when the response has been received
                });

And this is PHP part:

$id_user= $_POST['id_user'];
$reg_id= $POST['reg_id'];
$d_year1=$POST['d_year1'];
$d_month1=$POST['d_month1'];
$d_day1=$POST['d_day1'];
$d_year2=$POST['d_year2'];
$d_month2=$POST['d_month2'];
$d_day2=$POST['d_day2'];

Problem is that all the values sent with POST values are set on 0 and I can see in the post method that data is normally sent and the values are like this:

id_user:0010282658
reg_id:951
d_year1:2012
d_month1:05
d_day1:7
d_year2:2012
d_month2:10
d_day2:6
  • 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-13T07:39:40+00:00Added an answer on June 13, 2026 at 7:39 am

    Make sure you’re reading from $_POST and not $POST

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

Sidebar

Related Questions

I want to select all values that does not have a zero from the
I'm getting odd results from a MySQL SELECT query involving a LEFT JOIN ,
How to retrieve data from sqlite database? Getting return value zero. -(id)init{ if(self==[super init]){
I'm updating some old code that has several POD structs that were getting zero'd
I am having trouble getting the values of public variables file and desc set
This Javascript which uses functions from jQuery is quite handy but getting feedback on
I have a base class that I inherit from that has two zero to
I have zero idea as to why I'm getting this error.
I am getting an argument of length zero after running the code below. I
I am getting this error : ERRNO: 2 TEXT: Division by zero LOCATION: C:\xampp\htdocs\final\classes\customer.php,

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.