![]() |
Check if datastore entry exists?
I thought I saw the answer to this yesterday while searching the forums, but now I can't find the post. Now I can't fine the post.
What is the best way to test if a datastore entry exists before trying to use the data that is supposed to be there? Thanks, James --------------- Added [DATE]1432064018[/DATE] at [TIME]1432064018[/TIME] --------------- I think I found it. Does this look right? Code:
if ($vbulletin->datastore_item !== null) |
Man, I just read that whole section on NULL vs isset() vs empty() a few weeks ago and I already can't remember. I think what you have is right because IIRC I don't think there's any practical difference between a variable set to NULL and an unset variable.
|
I got that code bit from the first post in this thread:
https://vborg.vbsupport.ru/showthread.php?t=98047 |
Hmm...I guess at some point it used to be separate from $vbulletin (or $vbulletin didn't exist yet), but I wonder why they changed from isset() to !== NULL? Anyway, I guess that'll work.
|
All times are GMT. The time now is 05:38 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|