|
Posted by Joja on 12/19/06 13:34
Hi !
Maybe i have described this on the wrong way....
This is what im passing after you click update button:
<select name="options">
<option value="0" >Snow </option>
<option value="1" >Winter</option>
</select>
If i write this to db then i will write "0" or "1" and i want to store
"Snow" or "Winter" into db.
I have to use numerical values for my other use with select, but i must
store text into db.
So i can make something like this:
if (options = "0" )
options = "Snow";
write options into db.
*********************************************************
"Moot" <mootmail-googlegroups@yahoo.com> wrote in message
news:1166533643.198585.13350@79g2000cws.googlegroups.com...
> Joja wrote:
> > I have one page where im making update.
> > In one case im passing numerical values from dropdown ( on the same
page ).
> >
> > Problem is that i want to save / update this numerical value as text,
before
> > i write this to db.
> > The numerical value of this dropdown is passed to to the same page (
after
> > update ) and i can store this numerical value into db but i i want to
change
> > this number to text then i get error:
> >
> > Cannot modify header information - headers already sent by (output
started
> > at
> >
> > I know why is this happening, but then, how and on which place can i
convert
> > number to text ( before i write this to db ).
> >
> > Thnx !
>
> You do not have to explicitly convert an int to a char.
>
> >From the manual:
> http://us3.php.net/manual/en/language.types.type-juggling.php
> "PHP does not require (or support) explicit type definition in variable
> declaration; a variable's type is determined by the context in which
> that variable is used."
>
> PHP will simply interpret the variable as a char when the context calls
> for a char and an int when the context wants an int. As for what your
> other problem is, I'm not sure, but type conversion isn't the cause.
>
> - Moot
>
Navigation:
[Reply to this message]
|