Re: Good SQL builder class
| From: | Tony Marston | Date: | Fri, 04 Dec 2009 13:29:30 +0000 |
| Subject: | Re: Good SQL builder class | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-300247@lists.php.net to get a copy of this message | ||
Take a look at http://www.tonymarston.net/php-mysql/databaseobjects.html
You can also download a working example of this code from
http://www.tonymarston.net/php-mysql/sample-application.html
--
Tony Marston
http://www.tonymarston.net
http://www.radicore.org
"Anton Heuschen" <antonfh@gmail.com> wrote in message
news:e6d501390912040509k1b27f082mc22ff95d460048bd@mail.gmail.com...
> Good day.
>
> I'm looking for a good class to handle building dynamically from and
> array (and if it is good it will automatically determine / or even
> have different methods) to handle mutli-dimensional arrays or simple
> associative arrays ... and build the SQL statement :
>
> for example I have an array :
>
> $home[$suburb]["street"] = test1;
> $home[$suburb]["housenr"] =2;
>
>
> Ok to keep it simple to 2, then I want to build the SQL like
>
> insert into homes (STREET, HOUSENR) VALUES ($val1,$val2);
>
>
> something like that, but I could also pass some array like :
>
> $home["street"] = test2;
> $home["housenr"] = 2;
>
>
> but the idea stays the same = the index is the name of the DB fields
> and the assigned value the element
>
>
>
> I have looked on hotscripts and phpclasses but I have no idea how good
> the solutions are that I have found thus far - therefor need some
> recommendation from someone else past experience of this