php - Insert values in mysql table with post method -


Currently I'm having trouble adding some lists to MySQL.

I have a table:

code> bidder

  column id type run_id min_bid max_bid   

me min_bid and MAX_BID . I'm getting this with the post method. This issue is that as I have different bidder types, I may need multiple prices for 1 bidder or I may only need 1 price.

I separated the post value, so I can distinguish the difference when I need it. To save 1 value or 2 values.

] = & gt; String (1) "5" ["get_bid1"] = & gt; String (1) "6" ["get_bid_low2"] = & gt; String (1) "7" ["get_bid_high2"] => String (2) "11" ["get_bids"] = & gt; The string {8} "set bid"}

then the table bidder must be saved like this:

  + - ---------------------------------------------- + | ID | Type | Run_id | Min_bid | Max_bid | + ----------------------------------------------- + | 1 | Stable | 1 | 5 | 5 | | 2 | Stable | 1 | 6 | 6 | | 3 | Random | 1 | 7 | 11 | + ----------------------------------------------- + < / Code>  

All but min_bid and max_bid are already set up.

All I can think of is a whole lot of statement.

Note: Bidder's ID can not be sequential, because bidders can be removed via a button click. So after the bidder ID3, it's likely that the next ID is 5 instead of 4.

Any thoughts?

Resolving your answer partially:

One for each bidder id The foreach with the same driven id was to loop:

  $ strSql = 'Choose the ID from the bidder where run_id =' $ this- & gt; GetRunId () ';'; $ ArrIdBidders = $ objDatabase- & gt; QueryRalt ($ strSql);   

I had to change the name of the steeds to the same name as the random dialects in the post, so I could use the following foreign loops.

  Forex currency ($ arrIdBidders $ bidderkey => as of $) {$ biddernumber = $ bidderkey + 1; $ StrSql = 'Set up the updated bidder min_bid =' $ ArrBids ['get_bid_low' $ Biddernumber]. 'Where id =' $ ArrIdBidders [$ bidderkey] ['id']. ';'; $ BlnOke = $ objDatabase- & gt; Query ($ strSql); } Forex ($ arrIdBidders $ bidderkey => as of $) {$ biddernumber = $ bidderkey + 1; $ StrSql = 'Set update bidder max_bid ='. $ ArrBids ['get_bid_high' $ Biddernumber] 'Where id =' $ ArrIdBidders [$ bidderkey] ['id']. ';'; $ BlnOke = $ objDatabase- & gt; Query ($ strSql); }   

Hope to thank you for thinking about someone else.

Comments

Popular posts from this blog

Java - Error: no suitable method found for add(int, java.lang.String) -

java - JPA TypedQuery: Parameter value element did not match expected type -

c++ - static template member variable has internal linkage but is not defined -