MySQL & PHP - select/option lists and showing data to users that still allows me to generate queries

StackOverflow https://stackoverflow.com/questions/2541643

  •  23-09-2019
  •  | 
  •  

문제

Sorry for the unclear title, an example will clear things up:

TABLE: Scenario_victories

ID  scenid        timestamp      userid side    playdate
1   RtBr001   2010-03-15 17:13:36   7     1     2010-03-10
2   RtBr001   2010-03-15 17:13:36   7     1     2010-03-10
3   RtBr001   2010-03-15 17:13:51   7     2     2010-03-10

ID and timestamp are auto-insertions by the database when the other 4 fields are added.

The first thing to note is that a user can record multiple playings of the same scenario (scenid) on the same date (playdate) possibly with the same outcome (side = winner). Hence the need for the unique ID and timestamps for good measure.

Now, on their user page, I'm displaying their recorded play history in a <select><option>... list form with 2 buttons at the end - Delete Record and Go to Scenario

My script takes the scenid and after hitting a few other tables returns with something more user-friendly like:

  (playdate)   (from scenid)        (from side)
#########################################################
# 2010-03-10  Road to Berlin #1 -- Germany, Hungary won #
# 2010-03-10  Road to Berlin #1 -- Germany, Hungary won #
# 2010-03-10  Road to Berlin #1 -- Soviet Union won     #
#########################################################
     [Delete Record]              [Go To Scenario]

in HTML:

<select name="history" size=3>
  <option>2010-03-10  Road to Berlin #1 -- Germany, Hungary won</option>
  <option>2010-03-10  Road to Berlin #1 -- Germany, Hungary won</option>
  <option>2010-03-10  Road to Berlin #1 -- Soviet Union won</option>
</select>

Now, if you were to highlight the first record and click Go to Scenario there is enough information there for me to parse it and produce the exact scenario you want to see. However, if you were to select Delete Record there is not - I have the playdate and I can parse the scenid and side from what's listed, but in this example all three records would have the same result.

I appear to have painted myself into a corner. Does anyone have a suggestion as to how I can get some unique identifying data (ID and/or timestamp) to ride along on this form without showing it to the user?

PHP-only please, I must be NoScript compliant!

도움이 되었습니까?

해결책

분명히 당신은 옳습니다. Xcode 4.2.1 문제 경고와 4.3.1은 그렇지 않습니다.

@implementation MyClass


- (void) callMyPrivateMethod {
    [self myPrivateMethod];   //<--- xcode 4.2.1 issues a warning here. 
    return;
}

- (void) myPrivateMethod {
    return; 
}

@end
.

( '반환의 필요가 없다는 것을 압니다.

그러나 두 버전이 모두 제대로 빌드되고 메소드 이름에서 오타를 만들지 않으면 실행됩니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top