Re: [PHP] serialize() casts numeric string keys to integers

2012-11-12 Thread Adam Richardson
On Mon, Nov 12, 2012 at 2:18 AM, eyal.t eya...@zend.com wrote: Hi all, Was wondering whether the fact that serialize() casts numeric string keys to integers, is a bug, intended behaviour, or just something that is minor enough not to have bothered anyone yet? This behavior is consistent

[PHP] serialize() casts numeric string keys to integers

2012-11-11 Thread eyal . t
Hi all, Was wondering whether the fact that serialize() casts numeric string keys to integers, is a bug, intended behaviour, or just something that is minor enough not to have bothered anyone yet? ?php $arr1 = array('1'='string key'); // '1' will be casted to 1 $arr2 = array(1='integer

Re: [PHP] serialize an object

2007-04-20 Thread Eric Butera
On 4/19/07, Stut [EMAIL PROTECTED] wrote: Tobias Wurst wrote: i use serialize() to save my object in $_SESSION. Why? There's no point in serialising something into $_SESSION. Anything you put in there gets serialised by the session handler. That isn't necessarily 100% true.

[PHP] serialize an object

2007-04-19 Thread Tobias Wurst
hi, i use serialize() to save my object in $_SESSION. But i have one Problem: the member-variables from the baseclass are not saved.. :( How can i fix this? thanks in advance -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] serialize an object

2007-04-19 Thread Stut
Tobias Wurst wrote: i use serialize() to save my object in $_SESSION. Why? There's no point in serialising something into $_SESSION. Anything you put in there gets serialised by the session handler. But i have one Problem: the member-variables from the baseclass are not saved.. :( How can

Re: [PHP] serialize an object

2007-04-19 Thread Zoltán Németh
as far as I know serialize() saves all the properties of the object... and I think you can store objects in session without serializing it since PHP serializes-unserializes it for you automatically - or not? greets Zoltán Németh 2007. 04. 19, csütörtök keltezéssel 13.17-kor Tobias Wurst ezt

RE: [PHP] serialize an object

2007-04-19 Thread Buesching, Logan J
From the PHP manual: -Original Message- From: Zoltán Németh [mailto:[EMAIL PROTECTED] Sent: Thursday, April 19, 2007 8:40 AM To: Tobias Wurst Cc: php-general@lists.php.net Subject: Re: [PHP] serialize an object as far as I know serialize() saves all the properties of the object

RE: [PHP] serialize an object

2007-04-19 Thread Buesching, Logan J
Subject: Re: [PHP] serialize an object as far as I know serialize() saves all the properties of the object... and I think you can store objects in session without serializing it since PHP serializes-unserializes it for you automatically - or not? greets Zoltán Németh 2007. 04. 19, csütörtök

Re: [PHP] serialize an object

2007-04-19 Thread Richard Lynch
I'm wondering if the OP is failing to re-define the baseclass when loading in the saved object... But, yes, get rid of the by-hand serializing first, as PHP will serialize it for you. On Thu, April 19, 2007 7:40 am, Zoltán Németh wrote: as far as I know serialize() saves all the properties of

Re: [PHP] serialize() and special ANSI characters

2007-02-20 Thread Richard Lynch
Just a guess: You could perhaps run all your data through base64 encoding or somesuch to be certain the characters to be serialized are all nice On Mon, February 19, 2007 8:56 am, Youri LACAN-BARTLEY wrote: Hi all, I'm just curious to find out if I'm the only person to have bumped into this

[PHP] serialize() and special ANSI characters

2007-02-19 Thread Youri LACAN-BARTLEY
Hi all, I'm just curious to find out if I'm the only person to have bumped into this kind of issue with serialize/unserialize. When I try and serialize an array containing a string value with the ± character (alt+241 ASCII) such as : 120GB 2X512MB 15.4IN DVD±RW VHP FR The

Re: [PHP] serialize() and special ANSI characters

2007-02-19 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-19 15:56:15 +0100: I'm just curious to find out if I'm the only person to have bumped into this kind of issue with serialize/unserialize. When I try and serialize an array containing a string value with the ? character (alt+241 ASCII) such as : 120GB

Re: [PHP] serialize() and special ANSI characters

2007-02-19 Thread Youri LACAN-BARTLEY
Roman Neuhauser wrote: # [EMAIL PROTECTED] / 2007-02-19 15:56:15 +0100: I'm just curious to find out if I'm the only person to have bumped into this kind of issue with serialize/unserialize. When I try and serialize an array containing a string value with the ? character (alt+241 ASCII) such

Re: [PHP] serialize() and special ANSI characters

2007-02-19 Thread Roman Neuhauser
# [EMAIL PROTECTED] / 2007-02-19 17:29:53 +0100: Roman Neuhauser wrote: class serializeASCII241 extends Tence_TestCase { function testTruncates() { return $this-assertEquals( 120GB 2X512MB 15.4IN DVD, serialize(120GB 2X512MB 15.4IN DVD . chr(241) .

Re: [PHP] Serialize

2006-05-29 Thread Richard Lynch
On Wed, May 24, 2006 4:50 am, [EMAIL PROTECTED] wrote: Is a serialized array a safe string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? Assume that a Bad Guy is smart enough to get SOMETHING in there to mess you up, even if you serialize

[PHP] Serialize

2006-05-24 Thread phplist
Hi, Is a serialized array a safe string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? regards Simon. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Serialize

2006-05-24 Thread chris smith
On 5/24/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Is a serialized array a safe string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? *Always* escape your data. What if your array contains a quote? -- Postgresql php tutorials

Re: [PHP] Serialize

2006-05-24 Thread Andrei
It's not safe... if the array contains strings which contain ' or might screw your query... it's safe to escape the string result from serialize... Andy [EMAIL PROTECTED] wrote: Hi, Is a serialized array a safe string to insert into a mysql text field? Or is a function such as

Re: [PHP] Serialize

2006-05-24 Thread Robin Vickery
On 24/05/06, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi, Is a serialized array a safe string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? No, it's not at all a safe string to insert into a mysql text field. mysql_real_escap_string() is

Re: [PHP] Serialize

2006-05-24 Thread tedd
At 10:50 AM +0100 5/24/06, [EMAIL PROTECTED] wrote: Hi, Is a serialized array a safe string to insert into a mysql text field? Or is a function such as mysql_real_escape_string always needed? regards Simon. Simon: If you want to store a serialized array in mysql, then you must use

Re: [PHP] serialize() function

2006-04-14 Thread tedd
Jochem: $_SESSION has another advantage - everything you stick in it is automagically serialized and unserialized at end/start of the request. I didn't know that. Thanks, now I have to figure out a way to store a $_SESSION in a cookie and read it back without inferring with what the user is

Re: [PHP] serialize() function

2006-04-14 Thread Jochem Maas
tedd wrote: Jochem: $_SESSION has another advantage - everything you stick in it is automagically serialized and unserialized at end/start of the request. I didn't know that. Thanks, now I have to figure out a way to store a $_SESSION in a cookie and read it back without inferring with

[PHP] serialize() function

2006-04-13 Thread Nicholas Couloute
Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! ~Nick Couloute co-owner/Web Designer Sidekick2Music.Com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
Nicholas Couloute wrote: Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! ?php $o = new StdObject; $a = array(); $i = 1; $b = false; echo serialize($o),\n, serialize($a),\n, serialize($i),\n, serialize($b),\n,

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
Nicholas Couloute wrote: I was thinking of a news system with comments. fine. but what's that got to do with serialize() per se? or put another don't look at a function decide it might be useful and then force yourself to build an application with it cart before the horse and all that.

Re: [PHP] serialize() function

2006-04-13 Thread tedd
At 12:04 AM +0200 4/14/06, Jochem Maas wrote: Nicholas Couloute wrote: Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! ?php $o = new StdObject; $a = array(); $i = 1; $b = false; echo serialize($o),\n, serialize($a),\n,

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
tedd wrote: At 12:04 AM +0200 4/14/06, Jochem Maas wrote: Nicholas Couloute wrote: Are there any tutorials and uses for serialize() ? I went to php.net and it isn't well documented as I would hope! ?php $o = new StdObject; $a = array(); $i = 1; $b = false; echo serialize($o),\n,

Re: [PHP] serialize() function

2006-04-13 Thread Robert Cummings
On Thu, 2006-04-13 at 18:58, tedd wrote: Not that you don't know -- because I'm sure you do -- but for the benefit of others. One example, each domain has a limit of cookies (20) and you can use them up pretty quickly. However, if you place your data in an array, you could then serialize

Re: [PHP] serialize() function

2006-04-13 Thread Jochem Maas
Robert Cummings wrote: On Thu, 2006-04-13 at 18:58, tedd wrote: Not that you don't know -- because I'm sure you do -- but for the benefit of others. One example, each domain has a limit of cookies (20) and you can use them up pretty quickly. However, if you place your data in an array, you

Re: [PHP] serialize() function

2006-04-13 Thread Richard Lynch
On Thu, April 13, 2006 7:03 pm, Jochem Maas wrote: One example, each domain has a limit of cookies (20) and you can use I wasn't aware that there was a hard limit on cookies - I always thought this was a browser dependent setting ... not that I ever get above 2 cookies max (and mostly just 1

Re: [PHP] serialize() function

2006-04-13 Thread Richard K Miller
There's nothing special about the data returned by serialize() except that it can be safely written saved, transmitted, etc. To do anything useful with it you have to unserialize() it. The cool part about it is that you can serialize any data structure, like an entire array or object.

RE: [PHP] serialize

2005-09-26 Thread bruce
'; php-general@lists.php.net Subject: RE: [PHP] serialize I have an app that stores evaluation scores so I have 30+ values all within a certain range, currently in the db, each of these values has it's own column: Table test id user_id motivation caring

RE: [PHP] serialize

2005-09-26 Thread Murray @ PlanetThoughtful
murray... it may have been helpful to the guy to also give him an idea of your tbl structure. i think you're talking about something like: tbl schema EvalTBL -id -UserID -ScoreTypeID ScoreTBL -id -ScoreType table ScoreType could/would have as many different

Re: [PHP] serialize

2005-09-26 Thread Jake Gardner
-Original Message- From: Murray @ PlanetThoughtful [mailto:[EMAIL PROTECTED] Sent: Saturday, September 24, 2005 11:49 PM To: 'blackwater dev'; php-general@lists.php.net Subject: RE: [PHP] serialize I have an app that stores evaluation scores so I have 30+ values all within a certain

RE: [PHP] serialize

2005-09-26 Thread Murray @ PlanetThoughtful
Sent this to [EMAIL PROTECTED] but forgot to copy php-general... heh. Here it is again. I would use a table such as Table |_UserData Then use objects per user to store the data. class User { var TestScore; var ScoreType; ... var Vars; function

RE: [PHP] serialize

2005-09-25 Thread Murray @ PlanetThoughtful
I have an app that stores evaluation scores so I have 30+ values all within a certain range, currently in the db, each of these values has it's own column: Table test id user_id motivation caring personal_characteristics creativity, ...etc. If the client

[PHP] serialize

2005-09-24 Thread blackwater dev
I have an app that stores evaluation scores so I have 30+ values all within a certain range, currently in the db, each of these values has it's own column: Table test id user_id motivation caring personal_characteristics creativity, ...etc. If the client decides they want to

Re: [PHP] serialize

2005-09-24 Thread Gustav Wiberg
- Original Message - From: blackwater dev [EMAIL PROTECTED] To: php-general@lists.php.net Sent: Sunday, September 25, 2005 4:17 AM Subject: [PHP] serialize I have an app that stores evaluation scores so I have 30+ values all within a certain range, currently in the db, each

[PHP] serialize and unserialize

2003-12-22 Thread webmaster
Hello all i need a little help with serialize and unserialize here is my code ?php session_start(); if(!isset($_COOKIE['data'])) { //Check to see if cookie is there. include(cookie_num.dat); $y = $password; //Assign a special number

Re: [PHP] serialize and unserialize

2003-12-22 Thread Marek Kilimajer
You should use stripslashes to get rid of escaped characters in $_COOKIE['data']. Then remember to use addslashes when you want to use $data or $chksum in sql queries. [EMAIL PROTECTED] wrote: Hello all i need a little help with serialize and unserialize here is my code ?php

[PHP] serialize?

2003-07-08 Thread Sævar Öfjörð
Hi. I’m coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table ‘polls’. There I keep basic information such as the question, id etc. But should I keep the poll options in one field also? Then I would create an array from the poll

Re: [PHP] serialize?

2003-07-08 Thread Marek Kilimajer
No, use another table, poll_options: poll_option_id, poll_id, option_text, vote_count hope the structure is self explanatory. Svar fjr wrote: Hi. Im coding a poll system which stores information in MySQL. When a new poll is created a new row is inserted in the table polls. There I keep basic

Re: [PHP] serialize?

2003-07-08 Thread Dan Anderson
Because it is desirable to create many small tables over one very large table I usually allow PHP to create dynamic tables. For instance, you could have a table called polls, and use the row id to create a unique table: ?php $query = CREATE TABLE poll_number_{$poll_id]} ( . /*insert values

[PHP] serialize/unserialize problem

2002-12-17 Thread Guangzu Wang
Hi, I am working on mime message and try to pass an array with serialize and unserialize and got some problems. Here's some code snippet: in my function, I have this: $message['attachments'] = serialize($attachments); And calling code like this: $attachments = $message['attachments']; echo

Re: [PHP] serialize/unserialize problem

2002-12-17 Thread Guangzu Wang
! Guangzu - Original Message - From: Guangzu Wang [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, December 17, 2002 4:48 PM Subject: [PHP] serialize/unserialize problem Hi, I am working on mime message and try to pass an array with serialize and unserialize and got some

[PHP] Serialize/URLencode query...

2002-05-11 Thread Glenn Sieb
I'd like to pass a bunch of variables to another PHP page for processing there... I think serialize() and urlencode() will do what I'm looking for.. can I pass multiple strings through this? I'm also not clear on how I can decode the separate strings out... Can someone point me in the right

RE: [PHP] Serialize/URLencode query...

2002-05-11 Thread John Holmes
the previous page in the variable $_SESSION[name] It's a little different if you're not using PHP 4.2, so read the manuals on sessions... ---John Holmes... -Original Message- From: Glenn Sieb [mailto:[EMAIL PROTECTED]] Sent: Saturday, May 11, 2002 7:57 PM To: [EMAIL PROTECTED] Subject: [PHP

RE: [PHP] Serialize/URLencode query...

2002-05-11 Thread Glenn Sieb
At 12:11 AM 5/12/2002 -0700, John Holmes posted the following... You should use sessions. All you have to do is call session_start() at the beginning of your code. Then, any variable you want to save to the session, you simply use: That did the trick! Thanks for the explanation, John! Now I have

[PHP] serialize()

2002-03-27 Thread Rodrigo Peres
Hi list, I've already look at the php manual but couldn't figure out a way to use serialize to solve my problem. I have a form, with many fields like (name, age, adress, state), that I put a save button. This button allows my user to save the fields already filled in order to finish the form

[PHP] serialize

2002-03-05 Thread Axel Nilsson
Hi All! I use this code to create a number of fields in a form depending on what input number I use. My problem occurs when i am going to save it. Right now only the value of the last field gets stored. I want to serialize all values from all fields so that they can be saved as a stringvalue

Re: [PHP] serialize

2002-03-05 Thread Tom Rogers
hHi $data = serialize($felnummer); That should do it.. Tom At 12:58 AM 6/03/2002, Axel Nilsson wrote: Hi All! I use this code to create a number of fields in a form depending on what input number I use. My problem occurs when i am going to save it. Right now only the value of the last field

Re: [PHP] serialize

2002-03-05 Thread Erik Price
On Tuesday, March 5, 2002, at 09:58 AM, Axel Nilsson wrote: I use this code to create a number of fields in a form depending on what input number I use. My problem occurs when i am going to save it. Right now only the value of the last field gets stored. I want to serialize all values

Re: [PHP] serialize

2002-03-05 Thread bvr
Instead of serialize(), you could also fix your existing code like this: ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer INPUT TYPE=\ TEXT\ name=\felnummer[ $i ]\BR; } ? Or ?php for ($i=0; $i$HTTP_GET_VARS['num']; $i++) { echo felnummer

[PHP] serialize object session_auto_start

2001-12-05 Thread Matthieu Brunet
Hi, I'm trying to save an object in the session, with the serialize and uunserialize fonction. But i got an error message wich say me that i must define the class before the session start. But my session start automaticly. So I can't include my class before the session start. I'm looking for a

[PHP] php serialize

2001-07-03 Thread scott [gts]
does anyone know any good places to look for detailed information about PHP's serialize(), unserialize() (besides the PHP sources, becuase i'm already going thru them) i want to write serialize() and unserialize() in perl so that arrays (no objects or references yet) can be read/written by both

Re: [PHP] php serialize

2001-07-03 Thread Alexander Wagner
scott [gts] wrote: i want to write serialize() and unserialize() in perl so that arrays (no objects or references yet) can be read/written by both PHP and Perl to help with my cross-language session implementation. Why don't you use WDDX? regards Wagner -- Madness takes its toll.

RE: [PHP] php serialize

2001-07-03 Thread scott [gts]
Wagner [mailto:[EMAIL PROTECTED]] Sent: Tuesday, July 03, 2001 1:46 PM To: scott [gts]; php Subject: Re: [PHP] php serialize scott [gts] wrote: i want to write serialize() and unserialize() in perl so that arrays (no objects or references yet) can be read/written by both PHP and Perl

[PHP] serialize/unzerialize help

2001-03-16 Thread andrie
Hello all members, i am confuse to pass my class object over page (read my quote below). can u give a little example to demonstrate this using serialize and unserialize function. thaks for your attention.. andrie Tuesday, March 13, 2001, 9:03:08 PM, Loe nulis

[PHP] serialize/deserialize data

2001-02-12 Thread Brian V Bonini
What exactly does serialize/deserialize data mean? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

Re: [PHP] serialize/deserialize data

2001-02-12 Thread Steve Werby
"Brian V Bonini" [EMAIL PROTECTED] wrote: What exactly does serialize/deserialize data mean? See the manual at http://www.php.net/manual/en/function.serialize.php. Serializing is a way of storing values so that they retain their type and structure. Session variables are stored in this way.

Re: [PHP] serialize/deserialize data

2001-02-12 Thread Ankur Verma
ot;Brian V Bonini" [EMAIL PROTECTED] To: "PHP Lists" [EMAIL PROTECTED] Sent: Tuesday, February 13, 2001 5:36 AM Subject: [PHP] serialize/deserialize data What exactly does serialize/deserialize data mean? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail