You are here: Re: converting numerical values to char « All PHP « IT news, forums, messages
Re: converting numerical values to char

Posted by Moot on 12/19/06 13:07

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация