updated with db and php examples