My advice is to use it that value like a varchar(N), in order to avoid any kind of problems, obviously if you don't need to have some kind of calculation behind it, but i don't think as this bigint field is a facebook_id.<br>
<br><div class="gmail_quote">On Tue, Dec 28, 2010 at 8:28 PM, Andre Angelantoni <span dir="ltr"><<a href="mailto:aangel@mac.com">aangel@mac.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
When I use db_insert in D7 (RC3), drupal_write_record (the engine behind db_insert) allows ints, serials, and floats for numbers.<br>
<br>
If it sees int in the schema definition, it casts the number in PHP as an int before writing the record. Thus my facebook id of 100000412533411 becomes much much smaller. I have D6 code that I'm bringing to D7, btw.<br>
<br>
In common.inc:<br>
<br>
// Type cast to proper datatype, except when the value is NULL and the<br>
// column allows this.<br>
//<br>
// MySQL PDO silently casts e.g. FALSE and '' to 0 when inserting the value<br>
// into an integer column, but PostgreSQL PDO does not. Also type cast NULL<br>
// when the column does not allow this.<br>
if (isset($object->$field) || !empty($info['not null'])) {<br>
if ($info['type'] == 'int' || $info['type'] == 'serial') {<br>
$fields[$field] = (int) $fields[$field]; // ****HERE***<br>
}<br>
elseif ($info['type'] == 'float') {<br>
$fields[$field] = (float) $fields[$field];<br>
}<br>
else {<br>
$fields[$field] = (string) $fields[$field];<br>
}<br>
}<br>
<br>
There doesn't appear to be a way to insert bigints using db_insert<br>
<br>
...or am I completely missing something?<br>
<font color="#888888"><br>
-Andre'<br>
<br>
</font></blockquote></div><br><br clear="all"><br>-- <br>Paolo Mainardi<br><br>CTO Twinbit<br>Blog: <a href="http://www.paolomainardi.com" target="_blank">http://www.paolomainardi.com</a><br><br>-- Please consider the environment before printing this email --<br>