- To: Chris Barnes <Chris_Barnes@xxxxxxxxxxx>
- Subject: RE: [SLUG] PHP question..
- From: Greg Hosler <hosler@xxxxxxxxxxx>
- Date: Sun May 27 12:39:01 2001
- Cc: "slug@xxxxxxxxxxx" <slug@xxxxxxxxxxx>
- Reply-to: Greg Hosler <hosler@xxxxxxxxxxx>
On 27-May-01 Chris Barnes wrote:
> Thanks Jeff...
> By the way, what do you mean by now I can upgrade to PostgreSQL??
> hehe..I like MySQL =op
MySql is not really suitable as a dbengine for a web service, especially
one that will allow users to update the database (i.e. add records), except
under the simplest of conditions and most awarefulness of constraints.
While mysql has alot of appeal, it lacks transactions, and it lacks any
reasonable record locking features (true, recent versions of mysql have some
record locking in place, but it is heavily constrained, and no where near as
complete as it should be).
In short, mysql doesn't support multiple users *which is exactly what you will
see on a busy web server* - yes, you will see documentation that says that it
does, and so long as they all are only reading records, yes, it does, and you
will be fine. but as soon as you start having at least one writer, amoungst the
readers, you may have problems. and as/when you have multiple writers, you will
probably have problems, unless you design your application with the constraints
of mysql in mind (and no one should ever design an app with such constraints in
mind, quite frankly).
PostgreSql, on the other hand supports sophisticated record locking, as well as
transactions, and this makes it at least an order of magnitude more robust that
mysql.
rgds,
-Greg
> -----Original Message-----
> From: Jeff Waugh [mailto:jdub@xxxxxxxxxxx]
> Sent: Sunday, 27 May 2001 11:13
> To: 'slug@xxxxxxxxxxx'
> Subject: Re: [SLUG] PHP question..
>
>
> <quote who="Chris Barnes">
>
>> // Request the text of all the jokes
>> $result = mysql_query(
>> "SELECT ID,JokeAuthor,JokeDate,JokeText FROM Jokes");
>> if (!$result) {
>> echo("<P>Error performing sql query: " .
>> mysql_error() . "</P>");
>> exit();
>> }
>>
>> // Display the text of each joke in a paragraph
>> while ( $row = mysql_fetch_array($result) ) {
>> echo("<P>" . $row["JokeText"] . "</P>");
>> }
>>
>> I would really like the site to display the ID field with the date next to
>> it, then on a new line the JokeText, then on a new line the JokeAuthor.
> I've
>> been playing around with it but i keep getting PHP Parse errors...
>
> while ($row = mysql_fetch_array($result)) {
> echo "<p>" . $row[ID] . " - " . $row[JokeDate] . "<br>\n"
> . $row[JokeText] . "<br>\n"
> . $row[JokeAuthor] . "</p>\n";
> }
>
> You can span lines up until a semicolon, so I often lay the code out 'as
> displayed', like this (that's if I have any HTML written out from the code
> at all).
>
> Now you can upgrade to PostgreSQL! :)
>
> - Jeff
>
> --
> Toothpaste is the most important meal of the day.
>
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://lists.slug.org.au/listinfo/slug
>
> Searching for "A Better Way" to a home loan, call RAMS on 13 7267, or go to
> http://www.rams.com.au
>
> The e-mail and any attachments may contain confidential information. If you
> receive it in error you must not use or disclose the information. You must
> tell us and delete it. We do not waive any legal privilege by sending it.
> RAMS does not promise that the email is free from virus defect or error.
>
> --
> SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
> More Info: http://lists.slug.org.au/listinfo/slug
+---------------------------------------------------------------------+
"DOS Computers manufactured by companies such as IBM, Compaq, Tandy, and
millions of others are by far the most popular, with about 70 million
machines in use wordwide. Macintosh fans, on the other hand, may note that
cockroaches are far more numerous than humans, and that numbers alone do
not denote a higher life form." (New York Times, November 26, 1991)
| Greg Hosler i-net: hosler@xxxxxxxxxxx |
+---------------------------------------------------------------------+