[KLUG Members] database programming question

Bruce Smith bruce at armintl.com
Tue Jun 22 15:43:11 EDT 2004


> > First the KLUG server is already running Postgresql.  I wouldn't doubt
> > that MySQL would run at the same time, except the KLUG server is old,
> > slow, and has limited memory.
> 
> Won't know how it affects it unless we try.

True, and that's not my main concern either.

> > Second, the KLUG server already has a lot of information stored in
> > Postgresql.  All the meeting/presenter info, supporting member info,
> > library info, and probably more.  It would seem like there would be an
> > advantage of keeping everything all in the same database for ease of
> > retrieval and use.
> 
> That's a similar argument people use to stay with MS instead of
> switching to Linux. 

I'm not making any argument (yet).  I'm simply asking questions, trying
to understand some things and tell you our current setup.

> > I'm sure either Postgresql and MySQL would do the job on the KLUG server
> > equally well, BUT is it worth the effort convert everything from PG to
> > MySQL?  What would that gain us?  (other than your subjective reason).
> 
> I'm not arguing to convert data.  

OK, I've been doing this programming thing for over a quarter of a
century now, and I don't like where we're headed.  There is a big
advantage of doing thing correctly.

First off you're talking duplication of data.  There is already some
membership information in Postgresql (supporting member database). 
Do I need to explain why duplication of data is bad?

AND there are many advantages of standards.  Having some data in PG and
other data in MySQL sounds more like a cobble job than standards.

> My subjective reason produces objective results.  The proof's in the
> pudding.  I'm arguing that not using MySQL results in less
> development, fewer working programs.  The KLUG website seems to make
> my case.  

I totally disagree.  I can see where you may think that, but the choice
of database has nothing to do with lack of change on the KLUG website.

This is a volunteer organization.  No money (or other compensation) is
exchanged for services rendered.  Anyone who has been involved in a
volunteer organization knows how hard it is to get anything done.

It took us what, two years, to get someone to buy a toner cartridge for
a printer donated to KLUG?  I'm not picking on Brian here, all the KLUG
volunteers are guilty of doing their real job (and other things) before
KLUG work (to at least some degree).

We don't have people beating down our doors with LAMP scripts, and
walking away disappointed because we don't use MySQL.  And if we add
MySQL, we're still not going to have any more interest.  I'm being
realistic here, sorry!  (that's not counting your recent interest)

> I'm also arguing that using MySQL results in more development, more
> working programs.  

Why?

If the name of the php command is the only difference for using MySQL
vs. PG, what's the difference as far as PHP programming is concerned?

That's what I'm trying to figure out.  I haven't done much with MySQL &
PHP, so maybe the PHP code is easier.  If so, please enlighten me.

I'm not against MySQL, but I'd want to convert everything to MySQL to
standardize on programming and lack of duplication.

I'm also would like reasons to justify the time to do the conversion.

> I think the popularity of MySQL on websites makes my case there too.

Popularity doesn't hold any credibility with me.  A Ford Escort may be
more popular than a Cadillac, but it doesn't mean it's "better".
</bad analogy>

> > Also, can you explain why the advantages of LAMP over using PG?  Is PHP
> > easier?  
> 
> I'm a bit confused here.  I think you mean the difference between LAMP
> and LAPP.  

Yes, I think you got my point.

> Although I've never heard it referred to that way.  LAMP is
> Linux, Apache, Mysql, and PHP.  LAPP would be (I'm making this acronym
> up) Linux, Apache, PostGres, and PHP.  So both would be using PHP.

Right ...

> PHP rocks.  There's nothing like it for web development.  

I also like PHP, but I've never used anything else for comparison (other
than CGI), so I'm not going to say there is "nothing like it".

> > The "select" statements are basically the same, aren't they? 
> 
> The select statement is almost always the same as they're both SQL
> (Structured Query Language), a standardized way of querying dbs.

What I figured.

> $result=mysql_query($sql);
> 
> //or 
> 
> $result=pg_query($sql);
> 
> All of these are PHP statements.

As I suspected.

So, you're willing to help us if you can write PHP that says
"mysql_query", but not if you have to spell it as "pg_query"?

Why?

How about if we spell it "odbc_query"?  (or whatever the ODBC call is)
Then you won't have to know which DB you're using.  :-)

> Practically speaking you need 
> 
> 1. to have an efficient method of checking and handling errors (the web
> guarantees you'll have untrained people doing weird things, you need to
> catch all these).

Right ...  And PG reports errors too.  Why are MySQL's errors better?

> On my websites, for example, I'm immediately notified by e-mail (as I
> refuse to wear a pager) whenever a db error occurs.  The e-mail contains
> the error and description from the RDBMS, when it happened, what page it
> was on, who was doing it, what they're IP address is, what shoe size
> they wear, plus a boatload of other current information (variables) and
> settings on the server.  That way I can often find the problem and fix
> it before they leave the site.

Right, and that can be done in PG too.

> 2. a method to parse or pull out the results.
> 
> For the above statement, for example, after running the query, I'd be
> running another mysql related statement.
> 
> $row=mysql_fetch_array($result);
> 
> >From there, I'd assign values.
> 
> $name=$row["name"];
> $title=$row["title"];
> $address=$row["address"];  // etc, etc.

OK, that sounds a lot like "pg_fetch_array".  

So, where's the advantage of MySQL over PG there?

> 3. an easy method of creating, modifying, and managing tables. 
> PhpMyAdmin does this astonishingly well.  I think that MySQL here really
> separates itself from PostGres.  When I discovered years ago that
> PostGres wanted me to -recreate and repopulate- a table to make a simple
> modification, I left and haven't looked back.  I hear they can do that
> now, but there's no reason to return yet.
> 
> Practically speaking, once a MySQL database is created with a couple of
> logons, I can put up PHPMyAdmin and run major websites without ever
> again using a shell.  That's ease of use.

Yes, PHPMyAdmin is nice, and I've used very similar product for PG
(who's name is escaping me now).

> Convinced yet?

Maybe a little more convincing is needed?  :-)

 - BS




More information about the Members mailing list