need the number of seconds since.... |
It's not a unique value:
http://php.net/manual/en/function.uniqid.php That's why I'm using uuidv4. https://en.wikipedia.org/wiki/Universall...4_(random) Generated with random_bytes. http://php.net/manual/en/function.random-bytes.php
Thanks. I am going to try random_bytes(8). The combo of my sort field and my campaign field should be pretty unique.
proof that an old dog can learn new tricks
This line is failing:
$data['date_time']=random_bytes(8); //this is to create a unique number When I step through this line with the debugger, the code just crashes. (ie it gets stuck at this line). I am getting this apache error: PHP Fatal error: Call to undefined function random_bytes() in C:\\xampp\\htdocs\\sub_crud\\application\\controllers\\Subit_backend.php on line 364
proof that an old dog can learn new tricks
You can also get a unique number using the below.
PHP Code: $data = openssl_random_pseudo_bytes(16); It is part of PHP. What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |