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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T14:32:08+00:00 2026-06-16T14:32:08+00:00

I have these values which I need to save into MySQL (column DECIMAL 10,

  • 0

I have these values which I need to save into MySQL (column DECIMAL 10, 2).

-500.00
-500.00
35000.00

When a PHP script save these values into the database and I will take a look at these saved values, there is just:

500.00
500.00
5000.00

How’s it possible?

EDIT:

Saving into DB:

mysql_query("INSERT INTO table (name, address, salary) VALUES ('$name', '$address', $salary)");

I also tried to add apostrops to the $salary, but the same thing, didn’t help me to save the correct value.

EDIT 2:

When I print out the variables with these numbers before executing the SQL query, so the values are correct. But when I print out the currently executed SQL query, there are the incorrect values…

  • 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-16T14:32:09+00:00Added an answer on June 16, 2026 at 2:32 pm

    The column definition should be DECIMAL(10, 2) and not followed by UNSIGNED. The missing sign could be caused by an “unsigned”.

    The error on 35000.00 could be an output error (sprintf).

    Most uniformly, you remove the first char at output.

    Maybe you tried to change one ‘.’ in salary by nothing, removing the first character.

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

Sidebar

Related Questions

I have a php form which saves these values to the database: id rand
I have a Ci script outputting database values. On these values '#commentLink' and '#commentBox'
I have a field in my database that contain comma separated values these values
I have a string like val1_val2,val3_val4 and I need to split these values to
I have a database which contains tables of mapping values for a variety of
I have created a custom PHP script which uploads information submitted by a form
I have a MySQL database which currently uses a tinyint field to store the
I have a following situation in my project. There are some tag values which
I have these in a jsp file. But these values are not updated in
I have these tables and values: Table1 ------------------------ ID | Value ------------------------ 2 |

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.