06-28-2016, 12:41 PM
I added that function because that issue always baffled me, and then I never actually used it in writing userspice.
Let's say you want to add a new user named Bob to your database whenever someone visited your homepage (which wouldn't be advised).
Loading this page would echo out the latest "Bob" user id.
Let's say you want to add a new user named Bob to your database whenever someone visited your homepage (which wouldn't be advised).
Code:
<?php
Code:
$fields=array('username'=>"bob");
Code:
$db->insert('users',$fields);
Code:
$lastId = $db->lastId();
Code:
echo $lastId;
Code:
?>
Loading this page would echo out the latest "Bob" user id.