[Date Prev][Date Next][Thread Prev][Thread Next][Minivend by date
][Minivend by thread
]
Re: [mv] Can this be faster?
****** message to minivend-users from "Bill Randle" <billr@exgate.tek.com> ******
It seens horribly inefficent to search through all the user db entries
one by one comparing with a pair of [if] statements. Why not just
something like this (not actually tested):
[seti found][query st=db sql="
SELECT uname FROM userdata
WHERE (customer_code = '[scratch customer_code]'
and uname = '[value mv_username]'
"][/seti]
[if scratch found]<B>You are already signed up!</B>
[else]<B>Welcome new user!</B>
[/else][/if]
-Bill
On Jul 8, 8:33pm, Chris Rapier wrote:
} Subject: [mv] Can this be faster?
} ****** message to minivend-users from Chris Rapier <rapier@psc.edu>
******
}
} I'm using the following code to try and prevent users from signing up
} for multiple accounts. I need to do this because the users get a 1st
} order bonus. The customer code is a number that will be (hopefully)
} unique to each user based on their billing name and city/state/zip. I
} know this approach isn't perfect but I can't think of a better way at
} the moment.
}
} The following code should be mostly self explanatory. I was wondering if
} anyone could see a better way to handle this?
}
} [loop search="fi=userdata.txt/un=yes/ra=yes"]
} [seti db_customer_code][data table=userdata column=customer_code
} key="[loop-code]"][/seti]
} [seti uname][loop-code][/seti]
} [if type="scratch" term="customer_code" op="=~" compare="/[scratch
} db_customer_code]/"]
} [if type="!scratch" term="uname" op="=~" compare="/[value
} mv_username]/"]
} [set bonus_flag]2[/set]
} [/if]
} [/if]
} [/loop]
}
} Chris Rapier
} -
} To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
} email with 'UNSUBSCRIBE minivend-users' in the body to
Majordomo@minivend.com.
} Archive of past messages: http://www.minivend.com/minivend/minivend-list
}-- End of excerpt from Chris Rapier
-
To unsubscribe from the list, DO NOT REPLY to this message. Instead, send
email with 'UNSUBSCRIBE minivend-users' in the body to Majordomo@minivend.com.
Archive of past messages: http://www.minivend.com/minivend/minivend-list