Showing entries 41066 to 41075 of 44076
« 10 Newer Entries | 10 Older Entries »
Building a Outbound Link Tracker with PHP and MySQL

I thought I would take some time and increase my understanding of PHP and MySQL. I came up with an idea for a project and decided the lowest hanging fruit would be a script to track external links.

The script will reside on a go.domain.com subdomain with the name go.php. It takes a single parameter on the GET string named url, checks it for cleanness, checks that the referrer has the same domain name, then performs a 301 redirect and logs the request.

Here’s the table:

CREATE TABLE go_log
(
  access_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
  user_name VARCHAR(45) DEFAULT NULL,
  user_ip INT UNSIGNED NOT NULL,
  referer VARCHAR(500) NOT NULL,
  link VARCHAR(500) NOT NULL
) ENGINE=ARCHIVE DEFAULT CHARSET=utf8;

The referer and link columns are roughly twice as big as what a Google search reveals as the longest URL, just to be safe …

[Read more]
Multi-Server Partitioning (Part 1)

MySQL 5.1 introduces partitioning within the table level. Lots of nice performance gains to be had. This shows great dedication to establishing the product as Enterprise Level. But, 5.1 is still Beta. What can we do in the meantime till 5.1 is released? How about partitioning tables across several MySQL instances on different machines?

=> Read more!

Why multi-table cross-database deletes fail in MySQL

Sometimes multi-table deletes fail in MySQL with a message about an unknown table. In this article I’ll explain the exact combination of circumstances that cause it to happen. First, the symptoms: delete a from db1.t1 as a inner join db1.t2 as b on a.c1 = b.c1; ERROR 1109: Unknown table 'b' in MULTI DELETE This will happen if the following are true: No database is selected or one of the tables is not in the current database The tables are aliased According the the MySQL documentation,

Good, Fast, Cheap. Pick any two.

Most people would have heard that saying before. It seems to hold up in most areas of life where pretty much everything has to follow this rule or be deemed practically or economically impossible. You can't buy a car that is good, fast and cheap. Nor a computer. Nor (insert-most-any-product-or-service-here). If your car is good and cheap then you probably won't be breaking any speed limits. If your computer is cheap and fast then it is likely to be of dubious reliability.

The software industry is bound by the same restrictions. Traditionally having good software that gets the job done promptly and does it well means laying out significant sums of money. NASA's equipment has to be good and fast as their margin for error is so small, therefore their budget is large. Apple's products have a historical reputation for being good and fast and definitely not cheap. Microsoft's products have a reputation for being cheaper than Apple's, but also …

[Read more]
To BLOB Or Not To BLOB

A topical question is whether BLOBs should be served from a database. My colleague, Jim Starkey, invented the term BLOB and, understandably, is enthusiastic about the concept. However, others are concerned about the practical overhead. So, after some discussion, the answer is maybe, depending on your application. Here's a guide for whether hold your BLOBs in or out of a database:

  1. If your BLOBs are *huge* (hundreds of megabytes) then use a filing system.
  2. If the size of your BLOBs are tiny (sector size or smaller) then use a database.
  3. If you need scale-out then you've got a borderline case. Keep reading.
  4. If you've got a huge number of BLOBs then you've got another borderline case.
  5. If you want concurrency then you've got another borderline case.
  6. If you want relational structure (categories, tags, RSS) then use a database.
  7. If you want historical copies then use …
[Read more]
Export CSV file from MySQL with headings in first row

A tip posted by Heywood in the MySQL manual on how to export headings in your CSV export....

Merci Beacoup pour Notres Amis Francaises

Life can be stranger than fiction.

On Tuesday I was on a MySQL/SugarCRM webinar, and Jacob from SugarCRM mentioned that their first translation was to French. Then, Wednesday morning, I got a translation of the opentaps CRM module into French . . . from the developers at Nereide and creators of Neogia, a sister project of opentaps developed in France.

What can I say?

Merci beacoup! Viva la France, la terre de liberte, egalite, fraternite . . . et logiciel libre!

Export CSV file from MySQL with headings in first row

A tip posted by Heywood in the MySQL manual on how to export headings in your CSV export....

Google Video: MySQL Performance Tuning Best Practices

Jay Pipes is a co-author of the recently published Pro MySQL recently spoke at Google on MySQL Performance Tuning Best Practices

You can check out a video of the presentation on Google Video

There is also a good video from Google called The Paradox of Choice: Why More is Less.

Open Source and Money

Matt Asay wrote an article about open source leakage. It’s quite good, and got me thinking.

First I thought, “Open source companies do not ‘lose’ revenue to non-paying customers, they just do not gain revenue from them.” But that’s based on the model of open-source software I have in my head that open source software usually starts out as a free, collaborative effort, and if enough folks get enough steam and come up with a business model (aka “a way to get paid”), then they form a company around the open source software.

Simplifying that model: open source software is free until it’s not.

Saying there is leakage does not do justice to the fact that the river flowed freely until the company came along and dammed up the river. Sure, maybe there’s a big leak, but there’s a lot more not leaking …

[Read more]
Showing entries 41066 to 41075 of 44076
« 10 Newer Entries | 10 Older Entries »