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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T23:34:56+00:00 2026-05-14T23:34:56+00:00

I have this query: UPDATE table_name SET field_1 = field_1 +100, field_2 = field_2

  • 0

I have this query:

UPDATE table_name 
  SET field_1 = field_1 +100,
      field_2 = field_2 +100,
      field_3 = field_3 +100
WHERE id = 1 
LIMIT 1;

Where Field_1 is regular integer, Field_2 is decimal(15,6) and Field_3 is double(15,6).
When I run this query from php script they update just field_1 and nothing happen with field_2 and field_3 they just stay as before. But when I run in phpMyAdmin it’s work without any problems.

I’m tried to lock tables, make round() before run update, nothing help.

Please help… why I can’t update decimal and float fields from php?

PHP version: 5.2
Mysql version 5


Nothing help. But I found one small solution (I want to go away from it). When I run next query like


INSERT INTO error SET error_type = ' ;

Of course this is return error but previous query with update update all fields.

Any suggestion?

  • 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-14T23:34:57+00:00Added an answer on May 14, 2026 at 11:34 pm

    One of the possible problems:

    Locale. If You use non English – American locale, there is a chance, that Your numbers are interpreted incorrectly – decimal separator is not “.”, but “,”, just try insert “,” instead of “.” in Your float numbers and look what happens. If thats the case, You’ll have to either write a converting function in PHP (which PHPAdmin has, thats why You don’t face the problem there), or change the locale.

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

Sidebar

Related Questions

I need to have MySQL query like this one: UPDATE table_name SET 1 =
I have this SQL update query: UPDATE table1 SET table1.field1 = 1 WHERE table1.id
I have this query, which works... UPDATE `contacts` SET `calls_to`=`calls_to`+1 WHERE `contact_no` = '0412345678';
I have this query in sql server 2000: select pwdencrypt('AAAA') which outputs an encrypted
I have this query statement and want to only get records that has a
I have this query in LINQ to Entities. var query = (from s in
I have this query: SELECT page.id, revision.title, revision.number FROM page INNER JOIN revision ON
I have this query this.FixturePartidoPuntaje.Load(); var partidos = from q in this.FixturePartidoPuntaje where (
I have this query: criteria = session.CreateCriteria(typeof (Building)) .CreateAlias(Estate, estate) .SetProjection(Projections.ProjectionList() .Add(Property.ForName(Name), BuildingName) .Add(Property.ForName(estate.Name),
I have this query working but it is not returning back exactly what I

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.