Insertion of integer in a database
| From: | david joffrin | Date: | Wed, 23 Mar 2005 21:00:32 +0000 |
| Subject: | Insertion of integer in a database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-211412@lists.php.net to get a copy of this message | ||
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