Re: [PHP] get size of variable n bytes

2003-07-16 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 16:35,
lines prefixed by '>' were originally written by you.
> Yes, well, that complicates things.
> You see, I'm trying to determine the size that the $_POST variable
> will be
> in bytes, because there is a byte limit in the php.ini file for POST
> variable size, so I was hoping for something easy like
> bytes_size($_POST)...
> Would also be handy to calculate how much memory your script will
> use/need.
> So, you say there is no such function or no way to determine it?

The POST data is all sent as text anyway so what I said about assuming 1
character = 1 byte will be the best way of calculatuing the size of the
entire request (remember to include all variable names, ?, & and =
characters as well though).

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] get size of variable n bytes

2003-07-16 Thread Petre Agenbag
Yes, well, that complicates things.

You see, I'm trying to determine the size that the $_POST variable will be
in bytes, because there is a byte limit in the php.ini file for POST
variable size, so I was hoping for something easy like bytes_size($_POST)...
Would also be handy to calculate how much memory your script will use/need.

So, you say there is no such function or no way to determine it?


-Original Message-
From: David Nicholson [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 16, 2003 4:36 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] get size of variable n bytes


Hello,

This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 15:31,
lines prefixed by '>' were originally written by you.
> One way would be to assume that 1 character takes 1 byte to store
> so...
>   $sizeinbytes = strlen($field);

Also, this will only work with text data as numbers types, bool types etc
will be stored differently.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] get size of variable n bytes

2003-07-16 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 15:31,
lines prefixed by '>' were originally written by you.
> One way would be to assume that 1 character takes 1 byte to store
> so...
>   $sizeinbytes = strlen($field);

Also, this will only work with text data as numbers types, bool types etc
will be stored differently.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] get size of variable n bytes

2003-07-16 Thread David Nicholson
Hello,

This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 14:52,
lines prefixed by '>' were originally written by you.
> Hi List
> Sorry, tried to find it in manual...
> I'd like to query a db and and see how big the result is in bytes. How
> can I do that?
> Thanks

One way would be to assume that 1 character takes 1 byte to store so...
  $sizeinbytes = strlen($field);

Obviously the amount of disk space that your database server takes to
store the field is going to vary from this so if you need to know that
exact value you will have to look for a function within your database that
will calculate it for you.

HTH,

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

  Professional Web Development by David Nicholson
http://www.djnicholson.com/

QuizSender.com - How well do your friends actually know you?
 http://www.quizsender.com/
(developed entirely in PHP)

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] get size of variable n bytes

2003-07-16 Thread Curt Zirzow
Petre Agenbag <[EMAIL PROTECTED]> wrote:
> Hi List
> 
> Sorry, tried to find it in manual...
> 
> I'd like to query a db and and see how big the result is in bytes. How
> can I do that?

how big as in how many records are back from the query?

look for _num_rows(), replacing dbserver with your database
your using.


> Thanks

Welcome

Curt
-- 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] get size of variable n bytes

2003-07-16 Thread Petre Agenbag
Hi List

Sorry, tried to find it in manual...

I'd like to query a db and and see how big the result is in bytes. How
can I do that?

Thanks


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php