View Single Post
  #9  
Old 12-30-2005, 10:39 AM
Lionel Lionel is offline
 
Join Date: Dec 2001
Location: Delray Beach, Florida
Posts: 3,277
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Here is a snaphop of my main predictions table

Here is how it works. Member comes on the site and select a game for predictions. He gets to put the scores for team1 and for team 2

then he gets to put who will score (from the checkboxes) and at what minute that score will happened in the textbox, separating 2 goals for same player by a space. (in my example I simulated a prediction for 5 goals and 4 inputs for minutes, one of them having scored twice, so same textbox has 2 value).

I have only one input per game per member, meaning in that structure I am posting in this post, a single line holds all the values serialized (although the prdplayer serialize was not necessary) . The rest is accomplish with LEFT JOIN. I am also posting how it looks in db.

And here is how I insert in the prediction table

PHP Code:
 if ($_POST['do']=='dopredict') {
if (!
$bbuserinfo['userid'] OR !($permissions['forumpermissions'] & CANVIEW))
{
print_no_permission();
}
$user=$bbuserinfo[userid];
$seasonid $_POST['seasonid'];
$thedivision $_POST['divid'];
$tid1 $_POST['teamid1'];
$tid2 $_POST['teamid2'];
$gameid $_POST['gameid'];
$predscore1 $_POST['predscore1'];
$predscore2 $_POST['predscore2'];
$predminutes1 serialize($_POST['predminutes1']);
$predminutes2 serialize($_POST['predminutes2']);
$tplayer1 serialize($_POST['predplayer1']);
$tplayer2 serialize($_POST['predplayer2']);
$DB_site->query("INSERT INTO cclpinternational_predictions(id,userid,gameid,divid,seasonid,teamid1,teamid2,predscore1,predscore2,predplayer1,predplayer2,predminutes1,predminutes2) VALUES ('NULL','$user','$gameid','$thedivision','$seasonid','$tid1','$tid2','$predscore1','$predscore2','".addslashes($tplayer1)."','".addslashes($tplayer2)."','$predminutes1','$predminutes2')");
 
$_REQUEST['forceredirect'] = 1;
$url "interschedule.php?cupid=$thedivision";
eval(
print_standard_redirect('redirect_predictionthanks'));

Attached Images
File Type: jpg snap.jpg (49.5 KB, 0 views)
File Type: jpg min.jpg (28.6 KB, 0 views)
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01763 seconds
  • Memory Usage 1,813KB
  • Queries Executed 12 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_php
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (2)postbit_attachment
  • (1)postbit_onlinestatus
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete