Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7685145
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T19:11:14+00:00 2026-05-31T19:11:14+00:00

I want to know whether the PHP serialize function is 100% secure, also if

  • 0

I want to know whether the PHP serialize function is 100% secure, also if we store serialized data into a database and want to do something after fetching it, will it be a nice way.

For example:- I have a website with different user privileges, now i want to store the permissions settings for a particular privilege to my database (This data i want to store is to be done through php serialize function), now when a user logs in i want to fetch this data and set the privilege for the customer.

Now i am ok to do this thing, what i want to know is, whether it is the best way to do or something more efficient can be done.

Also, i was going through php manual and found this code, can anybody explain me a bit what’s happening in this code:- [Specially why base64_encode is used?]

<?php 
mySerialize( $obj ) { 
return base64_encode(gzcompress(serialize($obj))); 
} 

myUnserialize( $txt ) { 
return unserialize(gzuncompress(base64_decode($txt))); 
} 
?>

Also if somebody can provide me their own code to show me to do this thing in the most efficient manner.

I have a problem, i have so many fields to take as privileges, now for say i have 45 modules for administrators and 30 modules for users to take under permissions/privileges. In future (as i am constantly working on this project) i will be adding more and more modules, lets say around 100 more, so how will i be able to define the privileges. And even i am adding a module to create customized groups having custom privileges. How will i achieve it, keeping efficiency in mind? Please help 😐

I AM NOT GOING TO USE SERIALIZED DATA FOR SEARCHING

My Database:-

Database Structure

Database Content

Note:- Users privileges will be granted through : privileges_level

Note:- In privileges_permissions i want to add all the privileges in a serialized form.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T19:11:15+00:00Added an answer on May 31, 2026 at 7:11 pm

    I want to know whether the PHP serialize function is 100% secure

    this function has nothing to do with security at all. It’s just a way to represent complex data structure as a string. that’s all.
    Database security is another matter, completely indifferent to the source of the form of the data.

    if we store serialized data into a database and want to do something after fetching it, will it be a nice way.

    Definitely NOT
    This way you are spoiling the whole neat idea of the relational databases, which you are supposedly using.
    A data should be present in the database in the Normal form, means atomic – each entity occupying distinct cell. Not a whole bunch of unstructured unaccessible data with no possibility of establishing any relation with other data.

    what’s happening in this code

    nothing sensible.

    To answer the question from the title

    • Do not store serialized data in mysql
    • Create a table/structure of tables that represents the data structure of your application, keeping all the data bits separated and accessible.

    I AM NOT GOING TO USE SERIALIZED DATA FOR SEARCHING

    This is but a delusion, from the lack of experience.

    Welcome back in couple months, with a question “help me to redone my setup! it is going out of control!”

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know that whether on a php page we can get browser
I want to know whether the conventions that are followed in cake php poses
Does anyone think or know whether PHP 5.2.18 is coming out? I want to
I want to know whether 301 redirect always preserve referrer. I make a page
I want to know whether it is possible to commit to a previous version.
I want to know whether it is possible to transform Relax NG XML with
I want to know whether Metro Applications developed using Visual Studio 11 Developer Preview
I am new to PhoneGap I want to know whether PhoneGap is only for
Using Python, I want to know whether Java is installed.
This is my first app with CI and I want to know whether $_POST

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.