Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

php

Name: Anonymous 2008-03-22 21:21

HAI GUISE!!
I'm building basically a frontend for a specific database in php using postgres as rbdms, I'm new to php so I have no experience, so I ask you about how should I wire everything:
·The C way, functions for everything, no classes.
·A class for the database that takes querys, connects to the database and such, and then use that from the different files.
·Do it like this guy says: http://www.odi.ch/prog/design/php/guide.php and have a struct-like class (I'd go for an array instead though) and classes that handle the queries for every table, all sharing the same connection
·Mix the last two.

So far I'm inclined the the last point, but with a limited database object that limits itself to expose the database api and close the connection when it's destroyed, but maybe it's a bit too overkill??

Name: Anonymous 2008-03-22 21:23

I feel kind of bad about it :(

Name: Anonymous 2008-03-22 21:23

Use PDO

Name: Anonymous 2008-03-22 21:55

Use a framework

Name: Anonymous 2008-03-22 22:03

>>3-kun is right!

Name: Anonymous 2008-03-22 22:22

There's no point to OO in PHP. It's not an OO language, don't try to force it to be one.

Name: Anonymous 2008-03-23 1:41

There's no point to programming in PHP. It's not a programming language, don't force it to be one.

Name: Anonymous 2008-03-23 1:48

>>7
Forget that. It's Turing complete.

Name: Anonymous 2008-03-23 5:47

>>8
*Touring

Name: Anonymous 2008-03-23 21:28

>>3
like in pdo_pgsql.so? I can't use it as requirement, this asignment's specs suck.
I think I'll go for the DAO route, my only problem with it is php not being really object oriented...

Name: Anonymous 2008-03-23 21:45

Just use the pgsql functions directly. What's the problem?

Name: Anonymous 2008-03-23 22:35

>>11
it's pretty ugly... nothing besides that... I think I'm just going to define a function for every action the page does and be done with it... I'm thinking DAO is too much...
And I'll keep the database class, just because it closes the connection at the end so it doesn't hang there (right now it just wrapes the pg_ functions and does a little error handling)

Name: Anonymous 2009-08-17 0:26

Lain.

Name: Anonymous 2010-12-06 9:55

Back to /b/, ``GNAA Faggot''

Don't change these.
Name: Email:
Entire Thread Thread List