Green Bay Packers Forum

Welcome to your Green Bay Packers Online Community!

Since 2006, PackersHome has been providing a unique experience for fans.
Your participation is greatly anticipated!
Login or Register.
10 Pages«<678910>
Options
Go to last post Go to first unread
Offline dhpackr  
#71 Posted : Monday, September 21, 2009 2:03:15 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
try using the code i posted for a drop down list
Offline Zero2Cool  
#72 Posted : Monday, September 21, 2009 2:17:47 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,448
Applause Received: 3,868
" said: Go to Quoted Post
try using the code i posted for a drop down list


I tried, but it's over my head. I don't understand the variables. They have no real meaning. i, i02? That's confusing to simple minded folk like me. Remember, I'm a VB programmer, I need pictures!!! lol


Drop Down List won't work too great. If you scroll you could inadvertently select a different team. That's why I went with radio buttons.
Offline dhpackr  
#73 Posted : Monday, September 21, 2009 3:15:41 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
" said: Go to Quoted Post


I don't understand the variables. They have no real meaning. i, i02? That's confusing to simple minded folk like me. Remember, I'm a VB programmer, I need pictures!!! lol


Drop Down List won't work too great. If you scroll you could inadvertently select a different team. That's why I went with radio buttons.


remember, if u choose a radio button, all that will show up in ur database is a 1 or 0

let's break this down
***********************************************************
1st pick a drop down list where the user either picks packers or bengals
&lt;?-----start php script

$01s = array("Packers","Bengals"); //here i am populating an array
//this is an array for a game.
//only two teams in this list are the packers and bengals
if (empty($01s[0])) {
echo '&lt;input type="text" name="01" class="textbox" value="' . $01. '" maxlength="255" /&gt;' . "\n";
}
else {
?>
&lt;select name="01" class="textbox"&gt;
&lt;option value=""&gt;-- please select --&lt;/option&gt;
&lt;?
// Print out position options
for ($i = 0; $i &lt; count($01s); $i++) {
echo '&lt;option value="' . $01s[$i] . '"';
if($01s[$i]==$01){echo " selected ";}
echo "&gt;" . $01s[$i] . "&lt;/option&gt; \n";
}
?>

************************************************************

2nd pick a drop down list where the user either picks Vikings or Lions
&lt;?-----start php script

$02s = array("Vikings","Lions"); //here i am populating an array
//this is an array for a different game.
//only two teams in this list are the Vikings and lions
if (empty($02s[0])) {
echo '&lt;input type="text" name="02" class="textbox" value="' . $02. '" maxlength="255" /&gt;' . "\n";
}
else {
?>
&lt;select name="02" class="textbox"&gt;
&lt;option value=""&gt;-- please select --&lt;/option&gt;
&lt;?
// Print out position options
for ($i = 0; $i &lt; count($02s); $i++) {
echo '&lt;option value="' . $02s[$i] . '"';
if($02s[$i]==$02){echo " selected ";}
echo "&gt;" . $02s[$i] . "&lt;/option&gt; \n";
}
?>

*************************************************************
so now i have two drop down lists for two different games. this code will go into my template file. it doesn't matter what u call the variable. I used 01 and 02, you can use whatever you wish.

*************************************************************
now you want to write a function to add picks to database
function add_pick(memberid,$01=null,$02=null) {
$id = $this->get_new_id();
$values = array (
$this->memberid(), $this->01 = $01;
$this->02 = $02;
);

$query = 'INSERT INTO ' . $this->get_table('whateverthetableis') . ' VALUES(?, ?,?)';
$q = $this->db->prepare($query);
$result = $this->db->execute($q, $values);
$this->check_for_error($result);

unset($values, $query);
return $id;
}
*************************************************************

modify the picks

function mod_pick() {
$values = array (

$res->get_01(),
$res->get_02()
);

$query = 'UPDATE ' . $this->get_table('whateverthetableis')

. ' 01=?,'
. ' 02=?,'


$q = $this->db->prepare($query);
$result = $this->db->execute($q, $values);
$this->check_for_error($result);

unset($values, $query);
}
*************************************************************
Offline Zero2Cool  
#74 Posted : Monday, September 21, 2009 3:44:26 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,448
Applause Received: 3,868
" said: Go to Quoted Post
remember, if u choose a radio button, all that will show up in ur database is a 1 or 0


[php]
&lt;input name='rdoGame14' type='radio' value='Bears' /&gt;Chicago Bears
&lt;input name='rdoGame14' type='radio' value='Packers' /&gt;Green Bay Packers
[/php]

That gives me the 'Bears' or 'Packers' for the value instead of 1 or 0. I've wrote the team names to the database.

In fact, if you go to Special Features > NFL Picks > 1 and make some selections and hit submit, it'll go to the database with the team names.

I'm using Week02 as my test dummy for validation. :)


[php] //code above scans all rdoGame values ...

$varSelection = array($int => array($x, $strSelection));

$int++;
echo $int . " number. &lt;br&gt;";
}
}
//replace this with a check to see if $int = total games for that week.
//if yes, then use a for each loop through the $varSelection array and send
//each pick to the db, one by one.
/if no, exit and alert user to make all selections.

echo $varSelection[0][0] . " - " . $varSelection[0][1] . "&lt;br&gt;";
echo $varSelection[1][0] . " - " . $varSelection[1][1] . "&lt;br&gt;";
echo $varSelection[2][0] . " - " . $varSelection[2][1] . "&lt;br&gt;";
[/php]


Basically, once I get how to increment a multidimensional array's index dynamically, I could be set to go. I have most of this all written down on how to go about it. Except the incrementation of the index in my array. It's only storing the last set of data instead of an index.
Offline Zero2Cool  
#75 Posted : Tuesday, September 22, 2009 5:49:42 PM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,448
Applause Received: 3,868
Woohooo!! I figured it out!! Works like a freaking champ!!

I got the array to increment the element and also figured out how to use the for each array to cycle through each element. w00t!

Now to implement the check for all games selected and finish the template.

POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
Offline Rockmolder  
#76 Posted : Tuesday, September 22, 2009 6:50:06 PM(UTC)
Rank: Veteran Member

FleaFlicker Fantasy Football - Bronze: 2010

Netherlands
Joined: 9/14/2008(UTC)
Applause Given: 245
Applause Received: 384
" said: Go to Quoted Post
Woohooo!! I figured it out!! Works like a freaking champ!!

I got the array to increment the element and also figured out how to use the for each array to cycle through each element. w00t!

Now to implement the check for all games selected and finish the template.

POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER
POW!!! RIGHT IN THE KISSER


[youtube]husjA7bfmug[/youtube]

I know, I know. Honeymooners for you old people.
Offline dhpackr  
#77 Posted : Wednesday, September 23, 2009 9:59:05 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
GR8 Job!
Offline Zero2Cool  
#78 Posted : Thursday, September 24, 2009 9:20:48 AM(UTC)
Rank: Premier Member

Yahoo! NCAA March Madness - Gold: 2015Yahoo! Fantasy Football - Gold: 2009FleaFlicker Fantasy Football - Silver: 2010Yahoo! NCAA March Madness - Silver: 2011ESPN NCAA March Madness - Bronze: 2010Yahoo! NCAA March Madness - Bronze: 2013

United States
Joined: 10/13/2006(UTC)
Location: Green Bay, WI
Applause Given: 2,448
Applause Received: 3,868
" said: Go to Quoted Post
GR8 Job!


Thanks. Now I'm trying to find my pseudo code on how to tally up the numbers or think of how I was planning on it in the first place. lol
Offline wpr  
#79 Posted : Thursday, September 24, 2009 11:42:02 PM(UTC)
Rank: Select Member

PackersHome NFL Pick'em - Gold: 2012PackersHome NFL Pick'em - Gold: 2013FleaFlicker Fantasy Football - Silver: 2014FleaFlicker Fantasy Football - Bronze: 2013

Joined: 8/8/2008(UTC)
Applause Given: 3,800
Applause Received: 1,932
" said: Go to Quoted Post
I have no idea what you are talking about, but thanks for keeping this site running!


Ditto.
Offline dhpackr  
#80 Posted : Thursday, September 24, 2009 11:57:16 PM(UTC)
Rank: Registered

Joined: 12/12/2007(UTC)
Applause Given: 36
Applause Received: 36
" said: Go to Quoted Post
" said: Go to Quoted Post
GR8 Job!


Thanks. Now I'm trying to find my pseudo code on how to tally up the numbers or think of how I was planning on it in the first place. lol


i was wondering about that, i sent you an PM.
Rss Feed 
Users browsing this topic
Guest (2)
10 Pages«<678910>
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Notification

Icon
Error


Fan Shout
Smokey (23h) : 60% chance of SNOW in GB on Sunday. Most likely to fall before noon .
Smokey (8-Dec) : JOIN THE FORUM AND POST YOUR VIEWS !
The_Green_Ninja (8-Dec) : ...bro his senior year turns into a different person drunk. Gets in fights. And one time trashed out a Pita Pit by throwing his food
The_Green_Ninja (8-Dec) : Fun fact from people I know who knew Dak Prescott when he was at Mississippi State...
Pack93z (7-Dec) : @Dhazer Winning the regular season title.... lol... good for a soggy cookie... see you in the playoffs.. ;)
Nonstopdrivel (7-Dec) : In any case, Rashaan Salaam died this week.
Nonstopdrivel (7-Dec) : Didn't there used to be a member who posted as Rashaan Salami?
Smokey (7-Dec) : REMEMBER PEARL HARBOR , 75 years ago today. God Bless America
Zero2Cool (7-Dec) : Today's Birthdays: Gilligan (46)
Smokey (7-Dec) : The TFFL could use 4 more like you Jon. Know any that wants to join next year ?
Smokey (7-Dec) : I am proud of you Jon .
Smokey (7-Dec) : Yes Jon, you can indeed be proud of your efforts . I am .
rabidgopher04 (7-Dec) : league behind you and the other guy.
rabidgopher04 (7-Dec) : @Smokey - tough competition for sure. I'm not holding my breath. Just glad I could rebound after a bad start. 3rd most points scored in the
Smokey (7-Dec) : You won what other league dhazer ?
Smokey (7-Dec) : for
Smokey (7-Dec) : Low blow dhazer, 5 min. in the penalty box foe slashing ! lol
Smokey (7-Dec) : Yes, fine job rabid. Now compete with the other 9 - 4 in the league . ;) LOL !
rabidgopher04 (7-Dec) : Correction: I am second seed in the playoffs
rabidgopher04 (7-Dec) : I crawled my way back from 2-6 to 7-6 to win my division and 3rd place in Tailgaters FFL. Playoff should be fun.
Zero2Cool (6-Dec) : ;-)
dhazer (6-Dec) : i clinched last place in the Packershome thanks to the awesome draft skills of smokey lol and won the other league
Zero2Cool (6-Dec) : Wow. Rashaan Salaam was found dead Monday night at a park in Boulder. Police said there was no sign of foul play. He was 42
Pack93z (6-Dec) : In one league I went from 2-5 to 8-5 and clinched a playoff spot... #Believe Best I have for the Packers at the moment.
Zero2Cool (6-Dec) : Sweet. I backed my sweet ass into the playoffs. 8th and final seed.
Smokey (6-Dec) : Thank you Zero, I also just finished the Reg. Fantasy season at #1 . (Tailgaters Fantasy Football League ) .
The_Green_Ninja (5-Dec) : Same ol' Jay xD
Zero2Cool (5-Dec) : Aaron Rodgers over the last 7 games: 302 passing yards/game, 19 TDs, 3 INTs, 104.6 passer rating. 212 rushing yards, TD.
Zero2Cool (5-Dec) : Nice! I noticed you rocked your NFL Picks this week too! Nice work!!
Smokey (5-Dec) : Yes, he got me 29 fantasy points !
Zero2Cool (5-Dec) : Didn't David Johnson have a really good game though?
DarkaneRules (4-Dec) : cardinals run game looks worse than ours
Zero2Cool (4-Dec) : Packers inactives v Texans: WR Trevor Davis CB Makinton Dorleant ILB Blake Martinez OLB Kyler Fackrell RG Lang C Tretter DT Christian Ringo
buckeyepackfan (4-Dec) : GOOD MORNING PACKER FANS! GAMEDAY! GO! PACK! GO!
Zero2Cool (2-Dec) : lol
Please sign in to use Fan Shout

2016 Packers Schedule
Sunday, Sep 11 @ 12:00 PM
at Jaguars
Sunday, Sep 18 @ 7:30 PM
at Vikings
Sunday, Sep 25 @ 12:00 PM
LIONS
Sunday, Oct 2 @ 12:00 AM
BYE
Sunday, Oct 9 @ 7:30 PM
GIANTS
Sunday, Oct 16 @ 3:25 PM
COWBOYS
Thursday, Oct 20 @ 7:25 PM
BEARS
Sunday, Oct 30 @ 3:25 PM
at Falcons
Sunday, Nov 6 @ 3:25 PM
COLTS
Sunday, Nov 13 @ 12:00 PM
at Titans
Sunday, Nov 20 @ 7:30 PM
at Redskins
Monday, Nov 28 @ 7:30 PM
at Eagles
Sunday, Dec 4 @ 12:00 PM
TEXANS
Sunday, Dec 11 @ 3:25 PM
SEAHAWKS
Sunday, Dec 18 @ 12:00 PM
at Bears
Saturday, Dec 24 @ 12:00 PM
VIKINGS
Sunday, Jan 1 @ 12:00 PM
at Lions

Think About It
Think About It

Recent Topics
8h / Green Bay Packers Talk / nerdmann

8h / Green Bay Packers Talk / nerdmann

8h / Green Bay Packers Talk / nerdmann

21h / Green Bay Packers Talk / The_Green_Ninja

21h / Fantasy Sports Talk / Smokey

8-Dec / Green Bay Packers Talk / Zero2Cool

8-Dec / Green Bay Packers Talk / Zero2Cool

8-Dec / Green Bay Packers Talk / steveishere

7-Dec / Green Bay Packers Talk / Porforis

7-Dec / Green Bay Packers Talk / Zero2Cool

7-Dec / Green Bay Packers Talk / PackFanWithTwins

7-Dec / Green Bay Packers Talk / Zero2Cool

7-Dec / Green Bay Packers Talk / Zero2Cool

6-Dec / Fantasy Sports Talk / Zero2Cool

6-Dec / Green Bay Packers Talk / packerfanoutwest


Packers Headlines