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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:08:35+00:00 2026-05-26T14:08:35+00:00

I am developing a trading site. Users will post some price, $100, $120 for

  • 0

I am developing a trading site. Users will post some price, $100, $120 for certain products. And I wanted to display highest price for that product, which means current highest price will replace the previous highest price. Tables of mysql is:

user_email //The user who gives price for the product
product//The product name
price//The prices that users posted
chosen//it will be 1 if it is highest otherwise 0

What I wanted to do is that if a user posted $100 for, for example, a book and it is currently highest price (chosen is one for this user) and site displays it. Another user posts $120 for that book and it is now highest price (chosen is 1) and for the previous user’s chosen is 0. I could not figure out how to compare prices for certain products and change all of the lower prices chosen 0 for that product. How can i do this? Sorry i am new:(

  • 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-26T14:08:36+00:00Added an answer on May 26, 2026 at 2:08 pm

    You can use the MAX function from MySQL to get the highest number of a colomn. Example :

        SELECT MAX(field) FROM `table_name` 
    

    You just need to add WHERE and it will confine the search fields.

    After, you update everything else with something like this

        UPDATE `table_name` SET `field` = 0 WHERE `product` = "X" AND `id` != Y
    

    X will be the product ID and Y will be the ID from the first query.

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

Sidebar

Related Questions

I´m developing a Book Trading System... The user will input your Book to trading...
Developing a project of mine I realize I have a need for some level
I'm developing C extensions from python and I obtain some segfaults (inevitable during the
Developing an application for Android, i want to record data that will be usefull
I am developing a trading engine and i have to use FIX engines. If
Developing a site that requires monthly subscriptions via PayPal. If a buyer has an
Developing a series of POCOs on my project, and just realized that some of
this is my first time to post a question here, I will try to
Developing a WP7 app, and I'm trying to post something to the user's feed.
Background: Developing a trading system which subscribe to many events which are sent by

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.