DrupalBin
Submit Code
About
Recent Posts
Can't create Event nodes programatically
1 hour 27 min
ago
Fix for login d6
1 hour 58 min
ago
login d6
2 hours 4 min
ago
tab hack with the use of tab module
3 hours 2 min
ago
more
Tags
CCK
drupal
fapi
jquery
menu
module
Panels
simpletest
template.php
test
theme
views
more tags
User login
Log in using OpenID:
What is OpenID?
Username:
*
Password:
*
Create new account
Request new password
Log in using OpenID
Cancel OpenID login
Home
computed field
Random non-colliding computed field values
February 18, 2008 - 12:30am — Anonymous
$rand
=
mt_rand
(
0
,
1000000000
)
;
while
(
(
int
)
db_result
(
db_query
(
'SELECT COUNT(*) FROM content_type_<content_type_name> WHERE field_<fieldname> = %d'
,
$rand
)
)
>
0
)
{
CCK
computed field
Read more