Re: Fwd: [PHP] Storing indefinite arrays in database
| From: | Benedikt Voigt | Date: | Wed, 11 May 2011 11:46:38 +0000 |
| Subject: | Re: Fwd: [PHP] Storing indefinite arrays in database | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-312757@lists.php.net to get a copy of this message | ||
Bastien,
thanks for the answer.
But as I understand the problem and your suggestion, this won’t work, or you have to explain it to
me with this example.
For example, let’s reduce the function to two input fields and the following functioning:
InputField1=A InputField2=B OutputField=X
InputField1=A InputField2=C OutputField=Y
How can you store this in the form you suggested in a relational database?
Or would a non-relational database (e.g. an OO-database) make more sense?
Thanks,
Ben
-----Ursprüngliche Nachricht-----
Von: "Bastien Koert" <phpster@gmail.com>
Gesendet: 10.05.2011 22:38:24
An: "PHP General list" <php-general@lists.php.net>
Betreff: Fwd: [PHP] Storing indefinite arrays in database
---------- Forwarded message ----------
From: Bastien Koert <phpster@gmail.com>
Date: Tue, May 10, 2011 at 4:37 PM
Subject: Re: [PHP] Storing indefinite arrays in database
To: Benedikt Voigt <Benedikt.Voigt@web.de>
On Tue, May 10, 2011 at 4:16 PM, Benedikt Voigt <Benedikt.Voigt@web.de> wrote:
> Hi,
> I'am very new to PHP, so please any comment is welcome.
>
> I want to write a function in PHP, which takes X arguments and outputs a
> value.
> The functioning of this function should be stored in a db (mydb? or better
> alternatives?)
> The function would look up the result in the db based on the X arguments.
>
> But how can I store X arguments and the corresponding output value?
> If I limit the X arguments to a specific number like N=10, then I could
> create N=10 +1 columns in a table.
> But how should I do it if I don't want to limit myself to a fix number?
>
> Thanks for any comment!
> Ben
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
My bad, copied only the OP not the list.
Create the DB to run in a vertical format
consider the horizontal style
record_id field1 field2 field3 fieldN
which is great for fixed designs
The vertical format would be
record_id attribute argument
--
Bastien
Cat, the other other white meat
--
Bastien
Cat, the other other white meat
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar