dhpackr
15 years ago
try using the code i posted for a drop down list
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Zero2Cool
15 years ago

try using the code i posted for a drop down list

"dhpackr" wrote:



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.
UserPostedImage
dhpackr
15 years ago



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.

"Zero2Cool" wrote:



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
<?-----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 '<input type="text" name="01" class="textbox" value="' . $01. '" maxlength="255" />' . "\n";
}
else {
?>
<select name="01" class="textbox">
<option value="">-- please select --</option>
<?
// Print out position options
for ($i = 0; $i < count($01s); $i++) {
echo '<option value="' . $01s[$i] . '"';
if($01s[$i]==$01){echo " selected ";}
echo ">" . $01s[$i] . "</option> \n";
}
?>

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

2nd pick a drop down list where the user either picks Vikings or Lions
<?-----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 '<input type="text" name="02" class="textbox" value="' . $02. '" maxlength="255" />' . "\n";
}
else {
?>
<select name="02" class="textbox">
<option value="">-- please select --</option>
<?
// Print out position options
for ($i = 0; $i < count($02s); $i++) {
echo '<option value="' . $02s[$i] . '"';
if($02s[$i]==$02){echo " selected ";}
echo ">" . $02s[$i] . "</option> \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);
}
*************************************************************
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Zero2Cool
15 years ago

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

"dhpackr" wrote:



[php]
<input name='rdoGame14' type='radio' value='Bears' />Chicago Bears
<input name='rdoGame14' type='radio' value='Packers' />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. <br>";
}
}
//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] . "<br>";
echo $varSelection[1][0] . " - " . $varSelection[1][1] . "<br>";
echo $varSelection[2][0] . " - " . $varSelection[2][1] . "<br>";
[/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.
UserPostedImage
Zero2Cool
15 years ago
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
UserPostedImage
Rockmolder
15 years ago

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

"Zero2Cool" wrote:



[youtube]husjA7bfmug[/youtube]

I know, I know. Honeymooners for you old people.
dhpackr
15 years ago
GR8 Job!
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Zero2Cool
15 years ago

GR8 Job!

"dhpackr" wrote:



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
UserPostedImage
wpr
  • wpr
  • Preferred Member
15 years ago

I have no idea what you are talking about, but thanks for keeping this site running!

"IronMan" wrote:



Ditto.
UserPostedImage
dhpackr
15 years ago

GR8 Job!

"Zero2Cool" wrote:



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

"dhpackr" wrote:



i was wondering about that, i sent you an PM.
So if you meet me Have some courtesy, Have some sympathy, and some taste
Use all your well-learned politesse, Or I'll lay your soul to waste
Fan Shout
Zero2Cool (16h) : Eagles WR DeVonta Smith will be a DNP in todayā€™s practice. Heā€™s dealing with back tightness. But the expectation is that heā€™ll play Sunday.
Zero2Cool (16h) : Jalen Hurts has cleared the concussion protocol. Heā€™s playing Sunday.
Zero2Cool (17h) : š•avier McKinney First Team All-Pro
Zero2Cool (21h) : NFL moves Vikings-Rams playoff tilt to Arizona due to fires
Zero2Cool (21h) : Rams lose home field advantage for Monday game.
Mucky Tundra (9-Jan) : Notre Lame=Notre Dame, Luckeyes=Ohio State, Pedo St=Penn St
Zero2Cool (9-Jan) : ... It clearly was not what we were supposed to be in, certainly."
Zero2Cool (9-Jan) : Hafley says 3rd and 11 call there was a miscommunication.
Zero2Cool (9-Jan) : The only team I know is Texas from that. Who are the other three?
Mucky Tundra (9-Jan) : Notre Lame vs Pedo St tonight and the Luckeyes vs Texas tomorrow
Mucky Tundra (9-Jan) : Stud
Zero2Cool (9-Jan) : E. Cooper. Rookie of Month. Defense.
Mucky Tundra (8-Jan) : @AaronNagler Ā· 2m Both Jordan Love and Malik Willis were Limited participants at Packers practice today.
Zero2Cool (8-Jan) : Johnson didn't make it until 2020. Ring 2023. šŸ¤· Personally, he should have been in years prior to Hall.
Zero2Cool (8-Jan) : HUMP DAY
beast (8-Jan) : Guys that have a good shot at making the NFL Hall of Fame usually get into their teams pretty fast
beast (8-Jan) : Yeah, but is Kampman and the others in the NFL Hall of Fame?
Zero2Cool (8-Jan) : Johnson was Hall of Fame, 2020. Should haev been in Ring a year later, not three years.
Zero2Cool (8-Jan) : I could be wrong there though
Zero2Cool (8-Jan) : Guys like Kampman, Tim Harris, Al Harris, etc all over 15 years. Hall of Fame is 5 year wait
Zero2Cool (8-Jan) : I guess I see players in Packers Hall come way later
beast (8-Jan) : Yeah, usually teams hall of fames are a much lower bar than the NFL
Zero2Cool (8-Jan) : is it uncommon for Hall before Ring?
Zero2Cool (8-Jan) : S Xavier McKinney named first-team All-Pro by NFLPA
beast (8-Jan) : I missed it, sorry, but he got into the NFL Hall of Fame years before that
Zero2Cool (8-Jan) : Jones took his sweet ole time!
Zero2Cool (8-Jan) : Yeah, he's in the ring of honor, just saw video and his name is up there
Zero2Cool (8-Jan) : Didn't they have a thing in 2023 for Jimmy's ring of honor? I swear I saw it
beast (8-Jan) : Though if they're legitimately trying to re-sign MM, then it makes sense.
beast (8-Jan) : Jerry Jones still hasn't put Jimmy Johnson in the Ring of Honor, but he's in the NFL's Hall of Fame, Jones is petty
Mucky Tundra (8-Jan) : Unless the Cowboys are planning an extension, seems kinda petty
beast (8-Jan) : Cowboys denied Bears request
Mucky Tundra (6-Jan) : From what I'm reading, MM is under contract through the 14th of January; after that he's free game
Zero2Cool (6-Jan) : McCarthy let go or not extended??
Mucky Tundra (6-Jan) : Chicago Bears have asked the Dallas Cowboys permission to interview Mike McCarthy for head coaching vacancy
Zero2Cool (6-Jan) : The winners page that is
Zero2Cool (6-Jan) : I was not hoping for that. It messes up the page lol
beast (6-Jan) : Thank you, and I was really opening we were going to get 4 or more tied for the top 3.
beast (6-Jan) : Thank you, and I was really opening we were going to get 4 or more tied for the top 3.
beast (6-Jan) : Thank you, and I was really opening we were going to get 4 or more tied for the top 3
Zero2Cool (6-Jan) : congrats beast on 2024 !
Zero2Cool (6-Jan) : congrats porky on winning 2023 pick'em! (oops sorry)
Zero2Cool (6-Jan) : Packers have $60M+ of 2025 cap space on paper TODAY.
Mucky Tundra (6-Jan) : Missed FG into a Lions TD; that'll do pig, that'll do
Mucky Tundra (6-Jan) : That might be it for the Vikings
Mucky Tundra (6-Jan) : Oh so the refs do know what intentional grounding is
Mucky Tundra (6-Jan) : what the hell was that Goff?! Not much pressure and he just air mails it to Harrison
Mucky Tundra (6-Jan) : They really need to to get rid of the auto first down for illegal contact
Martha Careful (6-Jan) : watching the Vikings and Lions it's understandable why they swept the Packers. So much better product
Mucky Tundra (6-Jan) : Even when GB got pressure he was throwing darts; vs no pressure on that last pass he just air mails an open guy
Please sign in to use Fan Shout
2024 Packers Schedule
Friday, Sep 6 @ 7:15 PM
Eagles
Sunday, Sep 15 @ 12:00 PM
COLTS
Sunday, Sep 22 @ 12:00 PM
Titans
Sunday, Sep 29 @ 12:00 PM
VIKINGS
Sunday, Oct 6 @ 3:25 PM
Rams
Sunday, Oct 13 @ 12:00 PM
CARDINALS
Sunday, Oct 20 @ 12:00 PM
TEXANS
Sunday, Oct 27 @ 12:00 PM
Jaguars
Sunday, Nov 3 @ 3:25 PM
LIONS
Sunday, Nov 17 @ 12:00 PM
Bears
Sunday, Nov 24 @ 3:25 PM
49ERS
Thursday, Nov 28 @ 7:20 PM
DOLPHINS
Thursday, Dec 5 @ 7:15 PM
Lions
Sunday, Dec 15 @ 7:20 PM
Seahawks
Monday, Dec 23 @ 7:15 PM
SAINTS
Sunday, Dec 29 @ 3:25 PM
Vikings
Sunday, Jan 5 @ 12:00 PM
BEARS
Recent Topics
6h / Green Bay Packers Talk / Martha Careful

6h / Green Bay Packers Talk / Martha Careful

13h / Green Bay Packers Talk / Zero2Cool

17h / Green Bay Packers Talk / Zero2Cool

9-Jan / Around The NFL / beast

9-Jan / Green Bay Packers Talk / Zero2Cool

9-Jan / Green Bay Packers Talk / bboystyle

8-Jan / Around The NFL / beast

7-Jan / Fantasy Sports Talk / wpr

7-Jan / Green Bay Packers Talk / Zero2Cool

7-Jan / Fantasy Sports Talk / Zero2Cool

6-Jan / Green Bay Packers Talk / Martha Careful

6-Jan / Green Bay Packers Talk / Martha Careful

6-Jan / Green Bay Packers Talk / Martha Careful

6-Jan / Green Bay Packers Talk / beast

Headlines
Copyright Ā© 2006 - 2025 PackersHome.comā„¢. All Rights Reserved.