Gossamer Forum
Home : General : Databases and SQL :

Re: [Andy] Any insight into Rolling Sums in SQL

Quote Reply
Re: [Andy] Any insight into Rolling Sums in SQL In reply to
Andy wrote:
Hi,

Sorry, still not really enough info to be able to give a decent answer =)

1) What "field" is the prize held in?
2) Is the prize field actually "money"? (i.e so it can be totalled up)
3) Can you show a bit more of the code you just sent, with the SQL query you are using to grab the data.

That may help a bit more :)

Cheers

1) What "field" is the prize held in?
Its not held in a field as its a comparision.

2) Is the prize field actually "money"? (i.e so it can be totalled up)
Yes it is money

3) Can you show a bit more of the code you just sent, with the SQL query you are using to grab the data.
Code:
$result = mysql_db_query ($DBName, $query, $Link);
while ($row = mysql_fetch_array($result)){
if ($row[ticket] == "$ticketnumber"){
// Find how many match
if ($row[1] == $row[you1]){
$winner = $winner + 1;
}
if ($row[2] == $row[you2]){
$winner = $winner + 1;
}
if ($row[3] == $row[you3]){
$winner = $winner + 1;
}
if ($row[4] == $row[you4]){
$winner = $winner + 1;
}
Subject Author Views Date
Thread Any insight into Rolling Sums in SQL SandraR 15929 Oct 1, 2009, 11:26 PM
Thread Re: [SandraR] Any insight into Rolling Sums in SQL
Andy 15641 Oct 1, 2009, 11:36 PM
Thread Re: [Andy] Any insight into Rolling Sums in SQL
SandraR 15623 Oct 2, 2009, 12:05 AM
Thread Re: [SandraR] Any insight into Rolling Sums in SQL
Andy 15661 Oct 2, 2009, 12:17 AM
Thread Re: [Andy] Any insight into Rolling Sums in SQL
SandraR 15656 Oct 2, 2009, 12:23 AM
Thread Re: [SandraR] Any insight into Rolling Sums in SQL
Andy 15598 Oct 2, 2009, 12:29 AM
Post Re: [Andy] Any insight into Rolling Sums in SQL
SandraR 15528 Oct 2, 2009, 12:35 AM