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,385
Applause Received: 3,733
" 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,385
Applause Received: 3,733
" 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,385
Applause Received: 3,733
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: 244
Applause Received: 383
" 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,385
Applause Received: 3,733
" 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,641
Applause Received: 1,853
" 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 (1h) : Terrelle Pryor could see snaps at quarterback
Zero2Cool (1h) : inactives 6 Callahan 37 Shields 42 Burnett 52 Matthews 68 Murphy 95 Jones 98 Guion
Mucky Tundra (1h) : GET HYPE
Zero2Cool (1h) : Packers aim to showcase speed of Ty Montgomery, Trevor Davis
Zero2Cool (2h) : CB Quinten Rollins will start for Shields. Micah Hyde for Burnett. Julius Peppers for Matthews. Kenny Clark for Guion.
Tezzy (3h) : Probably will not be on the top of the Pick'Em leaderboard after today, soaking it in beforehand
Tezzy (4h) : Foosball!
yooperfan (4h) : Game day, tee it up and get this show on the road!
dyeah_gb (5h) : Dyeah! Go Pack!
buckeyepackfan (8h) : GOOD MORNING PACKER FANS! GAMEDAY! GO! PACK! GO!
flep (11h) : Gameday!!! Will see you all in chat later
The_Green_Ninja (15h) : Also, I'm not sure if you guys know. I'm a Memphis Tigers fan. Start looking a Riley Ferguson, QB. He is the real deal.
The_Green_Ninja (18h) : Big whoop, we have Aaron. We are going to win. H8ers.
Zero2Cool (20h) : Matthews, Burnett out; Guion, Jones doubtful
Zero2Cool (24-Sep) : thank ya
macbob (23-Sep) : HAPPY BIRTHDAY, KEVIN (yesterday...sigh...)
Zero2Cool (23-Sep) : Sam Shields has already been ruled out for Sunday's game.
Zero2Cool (23-Sep) : For Lions, Ansah is out. LBs Levy and Williams doubtful and Van Noy questionable. TE Ebron and DE Taylor questionable, too.
Zero2Cool (23-Sep) : Jimmy G sprained his AC joint
Mucky Tundra (23-Sep) : Brady is suspended and 2nd stringer Jimmy Garoppolo suffered a ACL sprain in week 2
Mucky Tundra (23-Sep) : Patriots 3rd stringer QB Jacoby Brissett injuried and needs surgery
Zero2Cool (23-Sep) : Quinten Rollins is the only NFL cornerback to play 20 or more snaps in the slot this year without allowing a catch
Porforis (23-Sep) : Cutler has better luck completing to Packers players 10+ yards downfield than Rodgers does. I say only mostly facetiously.
Smokey (23-Sep) : HELLO DAVE
The_Green_Ninja (23-Sep) : You people would think we have a QB worse than Cutler.
dyeah_gb (22-Sep) : Bench him!!!!
Porforis (22-Sep) : WE'RE TEARING EACHOTHER APART! CAN'T YOU SEE WHAT THEY'RE DOING? THIS IS JUST WHAT THE BEARS WANT!
Zero2Cool (22-Sep) : you
The_Green_Ninja (22-Sep) : **** you ****s who are losing faith in our MVP qb. Go Aaron and Go Pack Go
Zero2Cool (22-Sep) : “I know I’ve got to play better, and I will,” Rodgers said, via ESPN.com.
Mucky Tundra (21-Sep) : Nearing the end of the line for Adrian?
Mucky Tundra (21-Sep) : Adrian Peterson to miss time with meniscus injury
Mucky Tundra (21-Sep) : is that a good thign?
Zero2Cool (20-Sep) : Wheel routes galore!
Zero2Cool (20-Sep) : 40 yard dash time: 4.37 seconds
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
59m / Green Bay Packers Talk / nerdmann

2h / Green Bay Packers Talk / nerdmann

2h / Green Bay Packers Talk / nerdmann

2h / Green Bay Packers Talk / nerdmann

2h / Green Bay Packers Talk / nerdmann

23-Sep / Green Bay Packers Talk / PackFanWithTwins

23-Sep / Green Bay Packers Talk / yooperfan

23-Sep / Green Bay Packers Talk / yooperfan

23-Sep / Green Bay Packers Talk / nyrpack

22-Sep / Green Bay Packers Talk / sschind

22-Sep / Green Bay Packers Talk / DarkaneRules

22-Sep / Green Bay Packers Talk / DarkaneRules

22-Sep / Green Bay Packers Talk / The_Green_Ninja

21-Sep / Around The NFL / Smokey

21-Sep / Green Bay Packers Talk / steveishere


Packers Headlines