Re: Problem with row

From: Date: Sun, 07 Oct 2001 20:47:06 +0000
Subject: Re: Problem with row
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-70296@lists.php.net to get a copy of this message
looks like you want this in editweek.php : print $HTTP_POST_VARS['matchid']; as 'matchid' is the name of your <SELECT> box. or, if the register_globals setting is on (it is by default) in php configurations then you can also do : print $matchid; php doesn't remember every variable used in past scripts unless you tell it to. in this case, you are telling php about this html <SELECT> box, which holds your value of $wedstrijden[0] under the name 'matchid' as $wedstrijden[0] is the value defined in <OPTION>. hope that makes sense :-) if you're curious about all the POST variables passed with this form, quickly do (in editweek.php) : print_r($HTTP_POST_VARS); regards, Philip Olson On Sun, 7 Oct 2001, Martin Kampherbeek wrote: > Hi, > > I have a problem, when I choose a row in the select statement in the script > below I don't get a out put, see the second script. The outpunt must be > $volgende_id > > Can someone help me? > > Cheers, > Martin. > > <?PHP > Print("<form action=editweek.php method=POST> > print("<SELECT NAME=matchid SIZE=5>"); > mysql_connect("", "", "") or > die("<OPTION>Database error!</OPTION><?SELECT>"); > mysql_select_db("voorspelling"); > > $query = "SELECT id_match, home, away, time FROM matches ORDER BY time"; > $result = mysql_query($query); > while($wedstrijden = mysql_fetch_array($result)) > { > print("<OPTION VALUE=\"$wedstrijden[0]\">$wedstrijden[3] > &nbsp;&nbsp;&nbsp;&nbsp; $wedstrijden[1] - $wedstrijden[2]\n"); > } > print("</SELECT>"); > Print("<p><center><input type=submit > Value=Send!></center></p> > </form>"); > ?> > > ------------------------------------------------------------------- > editweek.php > > <?PHP > $volgende_id = $wedstrijden[0]; > print("$volgende_id"); > ?> > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#70296) next »