I’ve written a simple web frontend for the
perror utility which is provided by MySQL. Some
distributions, or some systems running older versions of MySQL do
not have this utility, and sometimes, I don’t have access to a
shell, I ran into this very problem over the weekend when I was
on vacation, so I needed a quick way to be able to lookup these
errors. Long story short, I now have this utility working and
it’s available to all. I figured I’m not alone, so I’d let
everyone hit it if they needed to.
You can get to it by just going to http://www.phpcult.com/mysql/123. Replace the last
thing with 123, 111, 122, 120 whatever and it will give you the
meaning. Hope this helps people.
Chris Shifflet just did his first “podcast”, he covers some nice topics regarding SQL injection, and just basic input filtering . Things to think about, tainting data with htmlentities/addslashes/stripslashes. Why to use mysql_real_escape_string . And, just some nice clear and simple explanations of why some settings are ON or OFF by default.
The Free and Open Source Software Conference
(FrOSCon) will take place from April, 29 to April, 30 2006 in
Sankt Augustin, Germany. It is organized by the Computer Science students of the University of Applied Sciences Bonn-Rhein-Sieg
and the Linux/UNIX Usergroup Sankt Augustin. The Call
for Papers will begin on November, 1 2005.
FrOSCon will offer Developer Rooms (just like …
MySQL Dashboard, seems like a great tool if you manage multiple database servers like I do. Currently, I am responsible for about 12 different database servers, with different amounts of load/data and users. It would be great to be able to use this tool to keep track of all the servers from a DBA perspective. Anyone aware of a similar tool in PHP ?
I love how Richard Heyes’ Application Structure post which describes his way of layint out PHP applications is similar to my own personal structure. I have been using something very similar for a few years now, which evolved by working with PHP applications and dealing with problems and how to avoid them in the future, so it’s amusing to see two people come up with something so similar.
I basically agree with the way he separates library code from normal PHP scripts that are available to the Web, but I do things a bit different. I use the following directory structure:
application root | +- crons +- include | +- jpgraph | +- pear | +- Smarty +- locks +- logs +- scripts +- setup +- templates +- templates_c +- webroot +- css +- images +- js
Explanation:
- …
[Update: Beta 3 is out; please report any/all bugs via http://bugs.php.net]
With the impending release of PHP 5.1b3, it's a good time to mention the status of PDO. We've had an excellent round of QA since beta 2, resulting in the following notable items:
- common core test suite to ensure individual driver conformance
- MySQL and PostgreSQL drivers now support native prepared statements and bound parameters (when available), for improved performance.
- OCI and ODBC drivers have been improved.
- PDOStatement::closeCursor() method has been added, to explicitly free up a database connection if you're done with a result set before you reach the end.
- Added $db->getAttribute(PDO_ATTR_DRIVER_NAME) to tell you which driver is in use (mostly useful for people writing layers over the top of PDO).
- Enabled the unix build of PDO_DBLIB, which provides access to Sybase/MSSQL servers …
After nearly 2 months of development FUDforum 2.6.14 is finally
out. Aside from the usual bug fixes this release includes a
number of important improvements, such as full support for PHP
5.1 and introduction of a PDO database driver support, which
enables FUDforum to talk with SQLite in addition to MySQL and
PostgreSQL.
In addition to all of the changes in found in RC1 and RC2 there
is a small number of modification made since then, a list of
which can be found below.
The installer and the upgrade script can be found at their usual
locations at:
http://fudforum.org/download.php and all FUDforum
users are encouraged to upgrade.
Continue reading "FUDforum 2.6.14 Released"
I've had a number of people ask me about this feature recently, and now it's here. What took so long? I just didn't have mysql 4.1 installed anywhere, or enough time to set aside to look into it. A patch from Guy Harrison (for multiple rowsets) caught me at just the right time today, and set me up for some hacking.
In CVS (and showing up on snaps soon), the pdo_mysql driver now has support for the following features when compiled against mysql 4.1 or higher:
- Support for queries returning multiple rowsets, via PDOStatement::nextRowset().
- Supports "native" sqlstate error codes, for "better" error reporting.
-
Supports native prepared statements and bound parameters.
I'm looking for feedback on these changes; even if you have an older mysql installation, please try the snapshot, as I want to ensure that it …
[Read more]
The 2nd release candidate of 2.6.14 was just published; this
release performs the final bit of cleanup, code rearrangement and
unification to make usage of PDO as a database interface
possible. As of this release it is now possible to install
FUDforum with the following PDO drivers: MySQL, PostgreSQL and
SQLite in addition to the native MySQL and PostgreSQL
interfaces.
Other important changes include fixes that accommodate the PHP
5.1 backwards compatibility (BC) breaks introduced after 5.1.0b1.
Also, FUDforum no longer requires temporary tables, making their
use optional, which should be welcome news to all the people who
don't have the necessary privileges to perform this
operation.
The installer and upgrade script are now available online and can
be downloaded from:
http://fudforum.org/download.php
The release also includes various …
PHP 5.1 is well on its way towards release, so very little time
is left to sneak in forgotten or missing features into it. One
very handy (IMHO) feature that I've added to the PDO MySQL driver
is the ability to toggle usage of buffered queries.
Up until now any query executed would be unbuffered, which
limited you to operation with just a single result cursor at a
time. The only way to avoid this limitation was to use fetchALL()
method to pre-fetch results into array and then use them. This
however is not always possible or practical as I've found out in
the progress of adding PDO support to FUDforum.
So, what do you do when something is lacking in PHP? Write a
patch of course!
As of yesterday you can set PDO_MYSQL_ATTR_USE_BUFFERED_QUERY
attribute to TRUE to enable buffered queries and FALSE to disable
them.
PHP:
<?php
…