You are here: Re: MySql VCHAR column converted to float by PHP :-( « PHP Programming Language « IT news, forums, messages
Re: MySql VCHAR column converted to float by PHP :-(

Posted by noone on 03/01/06 18:50

rass.elma@googlemail.com wrote:

> Hi all
> I fetch the following value from a string (VCAHR(250))colmun in a MySql
> table:
> "300000000000000000000000000000000000000000000000000"

> When I write it out using echo() I get :
> 3E+50

> Appearently the PHP interpreter converts the VCAHR value automatically
> in a float despite the fact that the value is defined as a VCAHR in
> MySql.
> While trying to convert float to string back in PHP using type casting
> or settype() I get always the string "3E+50".

> Does someone know how one can fetch the VCHAR as string?
> Does someone know how to print a formatted float to get the desired
> result? I tried printf() but no success.

> Thansk a lot:-)

> Ramon

try

$variable =strval($data); // get string value of a number

http://us2.php.net/manual/en/function.strval.php

 

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

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