Reputation: 453
Below is the code I currently have and it is working on passing week_num
. I am using session_start()
to pass my variables from page to page.
print'<form action="changeplayer_2.php" method="post">';
print"<select name='Week_select'> <br>";
while ($wrow=mysql_fetch_array($wresult)){
print '<option value="'.$wrow['week_num'].'">'.'week '.$wrow['week_num'].'
'.$wrow['week_name'].'</option><br>\n';
}
print "</select><br><br>";
What I am curious about is whether or not I can also pass week_name
to the next page.
Please keep in mind that I am still a beginner so I would appreciate anything you could tell me about why/how a fix will work.
I have tried
print '<option value="'.$wrow['week_num,week_name'].'">'.'week '.$wrow['week_num'].' '.$wrow['week_name'].'</option><br>\n';
and
print '<option value="'.$wrow['week_num','week_name'].'">'.'week '.$wrow['week_num'].' '.$wrow['week_name'].'</option><br>\n';
both of which generate errors
Upvotes: 0
Views: 301
Reputation: 29168
Try this concatenation:
print '<option value="'.$wrow['week_num'].'_'.$wrow['week_name'].'">'.'week '.$wrow['week_num'].' '.$wrow['week_name'].'</option><br>\n';
Upvotes: 1