Reply to Re: [PHP] Inserting NULL Integer Values

Your name:

Reply:


Posted by "Richard Lynch" on 10/18/05 21:41

$value2 = strlen($value2) ? $value2 : 'NULL';

On Tue, October 18, 2005 11:15 am, Shaun wrote:
> Hi,
>
> Up to this point in time I used to construct my insert statements like
> this
>
> $qid = mysql_query('INSERT INTO MYTABLE (
> column1,
> column2,
> ) VALUES (
> "'.$value1.'",
> "'.$value2.'"
> )');
>
> However I understand it is better to remove the quote marks around an
> insert
> if the column type is an integer. This is easy to do, however if the
> $value
> is empty it causes a mysql error. Has anyone encountered this and
> found a
> solution?
>
> Thanks for your advice
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--
Like Music?
http://l-i-e.com/artists.htm

[Back to original 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

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