Hello, What takes less time for the server: to find if some variable content exist in small DB (20 rows/records) or if some seesion content is a number/ string using the ctype_digit function ? Thanks, Roi.
My guess is using a session variable will be faster because you will access a value in memory instead of opening a database connection and retrieving the value from a table. Hope that answers your question.
Sessions should be faster, however, the speed between the 2 will most likely be negligible. If you're really concerned, do a benchmark of each. Qrite a quick script to run each 1000 times, and then run each loop 10 times and compare the averages.