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,356
Applause Received: 3,646
" 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,356
Applause Received: 3,646
" 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,356
Applause Received: 3,646
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: 240
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,356
Applause Received: 3,646
" 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,567
Applause Received: 1,801
" 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
uffda udfa (2h): Lol. I'm with ya, Bart Sibrel...just taking shot at Smoke being late to the party.
Zero2Cool (2h): no we did not
uffda udfa (2h): We landed on the moon. Yes!
Smokey (11h): Bridgewater dislocates L knee and tears ligaments . I can't celebrate that even if he is a Viking .
Smokey (16h): \_/
Smokey (18h): WHAT ?
Smokey (18h): Hip Hip Hooray ! John Wilkes Booth shoots Abe Lincoln !
Zero2Cool (19h): lol seriously??
uffda udfa (19h): Vikes fans are talking about Johnny Football.
Cheesey (19h): Well...being on the Vikings alone could cause cursing and throwing helmets!
uffda udfa (19h): Achilles?
Smokey (19h): Teammates seen cursing and throwing helmets .
Smokey (19h): Bridgewater/non-contact injury to L. knee/leg .
Zero2Cool (21h): Whoa Teddy bridgewater just went down looks serious Vikings end practice
Zero2Cool (21h): HEY! It could be a 6th rounder that turns into four 7th rounder (aka Jeff Janis!)
uffda udfa (21h): We really needed a 2018 7th rounder. Will really help DL issue.
uffda udfa (21h): Yes it is. Didn't see that blockbuster coming. Glad we got what's needed.
Zero2Cool (21h): Some uffda udfa recently claimed Packers never trade. HA, jokes on that clown!!! Bahahahahahahahah
uffda udfa (22h): TT with trade. Lerentee McCray to Bills for 2018 draft choice. 2018?
uffda udfa (30-Aug): Blackman officially waived. Perillo our 3rd TE and Randall starter opposite Shields.
uffda udfa (30-Aug): Crockett, Blackman and Henry expected to be waived per Demovsky
uffda udfa (30-Aug): Chargers cut our old friend, James Jones.
Zero2Cool (29-Aug): Packers release Peter Mortell.
Zero2Cool (29-Aug): Laser Gunns, why two accounts?
Zero2Cool (29-Aug): Patriots released DT Terrance Knighton
Zero2Cool (29-Aug): I'm glad you're back uffda. Keep it strong!
Zero2Cool (29-Aug): Cullen acknowledged he was wrong already. I guess I just dismiss bad blood on that fact.
Zero2Cool (29-Aug): Type F blood = bad blood bahahaha
uffda udfa (29-Aug): Definite bad blood. Cullen felt disrespect with no comm from TT at any point.
uffda udfa (29-Aug): Paul Kruger released by Browns. Cagy vet 3-4 DL we could use.
Zero2Cool (29-Aug): Bad blood? Hahhaha no!
Zero2Cool (29-Aug): Shallow to understand the Vikings aren't football? Lighten up buttercup!
uffda udfa (29-Aug): Cullen Jenkins working out for Skins. Should be for us. Bad blood there.
DoddPower (29-Aug): Fellow PackersHome members need you!
DoddPower (29-Aug): Opening in Pack Attack keeper league. Message me if you're interested.
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
39m / Green Bay Packers Talk / steveishere

2h / Green Bay Packers Talk / uffda udfa

2h / Green Bay Packers Talk / PackFanWithTwins

5h / Green Bay Packers Talk / DarkaneRules

5h / Featured Content / DarkaneRules

5h / Green Bay Packers Talk / DarkaneRules

11h / Green Bay Packers Talk / uffda udfa

13h / Featured Content / Zero2Cool

14h / Around The NFL / DarkaneRules

15h / Green Bay Packers Talk / yooperfan

18h / Green Bay Packers Talk / sschind

19h / Around The NFL / Cheesey

21h / Green Bay Packers Talk / luigis

21h / Green Bay Packers Talk / uffda udfa

21h / Green Bay Packers Talk / Barfarn


Packers Headlines