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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T05:54:32+00:00 2026-06-17T05:54:32+00:00

I am working on mobile app which has a mysql backend . Mysql is

  • 0

I am working on mobile app which has a mysql backend. Mysql is already desined database and currently running for the PC site too. So, I am developing separate front-end on mobile, but using the same database and writing my own php code to update the same database. My problem is that database has a column(price) whose type is float(giving type as only float with no extra information like (5,4) when I used desc.).

Problem is –> When I insert data as it is, like if user enters 1234, I am inserting into database as 1234 and it is stored in the same way. But when the same information is shown on the PC site, it displays 0.01 as 1234. So, I did some search on the data that is inserted from the PC site. They are inserted into database column like 1234000000, if user inserts 1234. While on the price info on website it shows correct price like 1234.

So, do I need to append six 0’s to my number to the end of it before inserting in my mobile php code or is there any type of formatting technique? Any help is greatly appreciated. Thanks in advance.

EDIT : Code snippet

$price = mysql_real_escape_string($_POST[$enteredprice]);

mysql_query("INSERT INTO item(s_secret, i_price) 
        VALUES('$secretcode','$price')",$db);

Where $price contains the value of price that user entered. As my above explanation, if user enters 1234, $price contains 1234.

  • 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-17T05:54:33+00:00Added an answer on June 17, 2026 at 5:54 am

    If you can’t alter the table as suggested to use fixed point, and are bound to the format you describe, you can do as below. It seems strange, though, that the field is float when there is no actual decimal value being used.

    "INSERT INTO item(s_secret, i_price) VALUES('$secretcode','".($price*1000000)."')"
    

    This assumes that you can specify values with decimals in your form.

    • 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 mobile website (it's not a single page app) which has
I am currently working on a mobile app that is going to communicate with
I'm working on mobile (Android/iOS) app, which will integrate with FB and have a
I am working on my own first mobile app which should be native on
I am working on a product which has both a desktop web site and
I'm currently working on a mobile app using Phonegap 1.4.1. On iOS (currently using
I am currently working on an Android application which has an ask a question
I am working on a EDIT: mobile web app which displays some sensitive information
I am working on a mobile app which needs a lot of data. Simply
I'm developing a jQuery Mobile app which really relie on Google Maps. Although 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.