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,325
Applause Received: 3,593
" 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,325
Applause Received: 3,593
" 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,325
Applause Received: 3,593
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: 239
Applause Received: 374
" 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,325
Applause Received: 3,593
" 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,506
Applause Received: 1,765
" 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
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
Zero2Cool (18h): NFL just needs more rules and intrusive Judging and Jury and Sentencing and it'll be w!n!
wpr (18h): I understand Pack93z. Unfortunately the good ol days are gone.
Zero2Cool (19h): Bahahaha
Zero2Cool (19h): It's hard for me to get amped when I'm so much more wise than the others here. *sigh*
Pack93z (19h): football is still in my blood... just not the current NFL product.
Pack93z (19h): Trying to get into TC mode and get amped for the season... alas, it just isn't the same passion I once had for the NFL product.. football is
Zero2Cool (28-Jul): I have a habit of hitting tab then space bar lol
Pack93z (28-Jul): .... and yes, that was a retyped message cause the user hit the enter key.. lol
Pack93z (28-Jul): It really isn't that big of a deal, more of a user problem that can't remember to stop and click in place of hitting a key... and yes, this
Zero2Cool (28-Jul): And it also won't do a full page refresh either.
Zero2Cool (28-Jul): I have to toss in an UpdatePanel and dedicate Enter to it for submission, then it will work.
Zero2Cool (28-Jul): nerdmann went bonkers with creating topics so we had to slow him down a tad lol
Pack93z (28-Jul): If I gotta field questions all week from this user base at work... going to share the "love".
Pack93z (28-Jul): There... that should miff Zero for a couple of seconds... ;)
Pack93z (28-Jul): Also.. when posting in the fan shout... why can't I hit the enter key to post a message?
Pack93z (28-Jul): What is this 5 minute wait cycle to create articles from the headlines... can't I spam them like hotcakes?
Mucky Tundra (27-Jul): haha
Zero2Cool (27-Jul): Crap, another meeting! Ugh!
Zero2Cool (27-Jul): Check in already! We waiting on YOU!!!
Pack93z (27-Jul): YES :)
Pack93z (27-Jul): --- KEVIN ----
Mucky Tundra (27-Jul): of the Dead?
Zero2Cool (27-Jul): --- SHAWN ---
Cheesey (25-Jul): Me neither. He did virtually nothing after he left the Packers.
Zero2Cool (25-Jul): WR Greg Jennings retires. I think I should be surprised, but I'm not.
Cheesey (23-Jul): It's sad, he was young.
wpr (22-Jul): Sorry to hear about Dennis passing away.
Zero2Cool (22-Jul): Hopefully people respect his passing without trying to make jokes.
Zero2Cool (22-Jul): Damn, Dennis Green passed away.
Zero2Cool (22-Jul): Bahahahah
Smokey (16-Jul): Playing 2016 Fantasy Football ? NO ? Contact me to join the Tailgaters Fantasy Football League !
wpr (15-Jul): Happy birthday since69
Zero2Cool (15-Jul): Whoa!Today's Birthdays: Since69 (51)
Zero2Cool (15-Jul): No sir. But at work we had our A/C go out, not fun lol
Smokey (14-Jul): Did recent bad weather affect you Zero ? ie: loss of electricity ?
Please sign in to use Fan Shout

Road To Super Bowl LI
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 @ 12:00 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 / wpr

8h / Green Bay Packers Talk / beast

8h / Green Bay Packers Talk / beast

9h / Green Bay Packers Talk / beast

12h / Green Bay Packers Talk / nerdmann

12h / Green Bay Packers Talk / DakotaT

13h / Green Bay Packers Talk / DoddPower

16h / Green Bay Packers Talk / buckeyepackfan

29-Jul / Green Bay Packers Talk / sschind

29-Jul / Green Bay Packers Talk / nerdmann

29-Jul / Green Bay Packers Talk / nerdmann

29-Jul / Green Bay Packers Talk / musccy

28-Jul / Green Bay Packers Talk / DakotaT

28-Jul / Green Bay Packers Talk / PackFanWithTwins

28-Jul / Green Bay Packers Talk / PackFanWithTwins


Packers Headlines