View Single Post
Old 07-21-2010, 09:32 PM   #2 (permalink)
dschreck
The Contributor
 
dschreck's Avatar
 
Join Date: Nov 2007
Location: California
Posts: 82
Thanks: 0
dschreck is on a distinguished road
Default

Since you're limiting them to two entries, you're going to need some application side logic to control that.

This could be pretty simple to integrate into the user flow if you have a specific page that they need to hit when registering a reservation.

For example:

PHP Code:

$sql 
"SELECT 1 WHERE member_ID = {$memberID}";
$res mysql_query($sql);
$numRows mysql_num_rows($res);

if(
$numRows 2)
{
   
// they can add a new one
}
else
{
 
// they can't 

Also note that you'll need a cron or script that will automagically clean up the table to remove all their past reservations. Or, you'd need a date where clause on the query.
__________________
Where I Ramble: http://www.iwilldomybest.com/
What I do: Zynga Game Network
Senior Software Engineer at CityVille
dschreck is offline  
Reply With Quote