Richard wrote:
How do I get the data from a mysql database into and array that looks
like this
Array ( [0] = 1 [1] = 2 [2] = 3 [3] = 4 [4] = 5 [5] = 6 )
by using mysql_fetch_row() or mysql_fetch_array()
The table has three fields but I only need the data from one field.
$query=SELECT amenityID
Stuart Dallas [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
As far as I know, serialize will handle multi-dimensional arrays. If I
were you
I would suck it and see.
And how should I store a serialized variable in my database? As String or as
Blob?
--
PHP
Depends on the average size of data that you're working with. You have to
count how many bytes each array take up. I think the sizeof function will
do this for you.
-Ed
-Original Message-
And how should I store a serialized variable in my database? As String or as
Blob?
On Tuesday, June 11, 2002 at 10:25:36 PM, you wrote:
I would like to know wether it's possible to put an array into a database?
If not, what is the best way to archieve something like that?
Yes it is. See http://www.php.net/serialize
--
Stuart
--
PHP General Mailing List
So this would handle 2-demensional arrays too?
So, if I have
$array = (
foo = bar,
wom = bat
);
it would work?
And darn, that I didn't come up with this (I'm familliar with Java, and they
use Serializable) ...
Stuart Dallas [EMAIL PROTECTED] wrote in message
[EMAIL
On Tuesday, June 11, 2002 at 10:59:00 PM, you wrote:
So this would handle 2-demensional arrays too?
So, if I have
$array = (
foo = bar,
wom = bat
);
(erm, i know it's late, but that looks like a 1-dimensional associative array)
it would work?
As far as I know, serialize
6 matches
Mail list logo