Jump to content

Serialize array


EchoFool

Recommended Posts

I need help with a serial array feature.

 

At the moment i have:

$items=serialize($_POST['array']); //takes the data from a post operation...

 

But i want to add a mysql_real_escape_string safety to it but how would it be written? do i have to put the serial in brackets after the mysql function ?

$items=mysql_real_escape_string(serialize($_POST['array']));  < would that work ?

Link to comment
Share on other sites

have you tried it?

 

I recently was shown a fun one

 

put

$_REQUEST = array_map( 'mysql_real_escape_string', $_REQUEST );

 

at the beginning of your code, will run every $_REQUEST variable through the mysql_real_escape string function and leave them all intact

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.