Reply to Re: [PHP] Insertion of integer in a database

Your name:

Reply:


Posted by Joseph Connolly on 03/23/05 23:14

I don't think the integer is the problem, but if it is you can turn
time() into a variable and then,

$time = time();



david joffrin wrote:

> Hi folks,
>
> Problem is fairly simple, but how can I insert integer in an SQL
> statement?
>
> So, I only had strings, but now I have introduced a timestamp column
> (bigint to cover the milleseconds), and I have the following statement:
> $queryInsert = "INSERT INTO mytables (..., timestamp) VALUES ('";
> $queryInsert .= ...; // several columns
> $queryInsert .= "', '";
> $queryInsert .= time() . "')";
> $result = mysql_query($queryInsert);
>
> This is not working as time() returns an integer and .= only works
> with strings!
>
> How can I cope with that?
>
> Thanks.
> DvJ
>

[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

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