Re: [phplib] change values in Database over php-Script, how to do with input-type 'radio'?? From: Stephen Woodbridge (woodbri <email protected>)
Date: 06/08/01

And if you want the selected value to reflect the value set in the DB
then make you radio button lines look something like:

<td width=20><input type=radio name="ObjArt" <? mysql_result($result,
$i, "ObjArt")=="Muhle"?"selected":""; ?> value="Muhle">Muhle</td>

and repeat for Reit and %

-Steve

Dima Nemchenko wrote:
>
> RPfeif123 <email protected> wrote:
>
> > Hello,
> >
> > I have the following question to you. I hope somebody can help me.
> > With the following input typ radio, the chosen value will be given to a
> > php3-script, which will do the query in the database. The result of this
> > query is given out in a html-document in a table. Now I want to change the
> > values of some rows in the database, for this I have to read them out in a
> > html-skript in order to change them. But how can i read the chosen Value of
> > the input type = radio.
> > For example, for the following input type=text, this is no problem, there is
> > only one value, here 100000,
> > <INPUT TYPE="text" NAME="Preis" VALUE="100000" SIZE="12" MAXLENGTH="12">
> > so I can do:
> > <INPUT TYPE="text" NAME="Preis" VALUE="<? Echo mysql_result ($result, $i,
> > "Preis"), ? > SIZE="12" MAXLENGTH="12"> to read the value out from the
> > database,
> >
> > but how can I do it for the following radio - input-type? Here I have 3
> > possible values, how can I see what value is chosen?
> >
> > INPUT-TYPE RADIO:
> > <tr><td width=20></td>
> > <td valign=top width="420">
> > <input type=radio name="ObjArt" value="Muhle">Muhle</td>
> > </tr>
> > <tr><td width=20></td>
> > <td valign=top width="420">
> > <input type=radio name="ObjArt" value="Reit">Reiterhofe</td>
> > </tr>
> > <tr><td width=20></td>
> > <td valign=top width="420">
> > <input type=radio name="ObjArt" value="%">keine Einschraunkung</td>
> > </tr>
> >
> > Thanks for your help, Ralf
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> > For additional commands, e-mail: phplib-help <email protected>
>
> Ralf,
>
> When you access the variable $ObjArt in PHP, its value will be either "Muhle",
> "Reit" or "%".
>
> Hope this helps,
> --
>
> :D_ima
> Dima Nemchenko <Dima.Nemchenko <email protected>>
>
> "Open source code is like lobster--most people who haven't tried it don't like
> the way it looks. But those who try it, love it."
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>