Archive for September, 2006

September 28th 2006

Using User-Defined Varibles in MySQL

Cast the first stone he who never made a mistake modeling a database! Every now and then in your career you will be face to face with a problem like this: due to the nature of a table’s data you created a table without a primary key, or using a composed key. So far so good, but due to an upgrade you see the need to have a unique key identifying all the registers in your table, in my case it was due to a AJAX interface.

So what now? You have a table full of data, and of course, as Murphy’s law will tell you, that data cannot be erased. MySQL will prevent you from turning a filled to a primary key if it finds duplicated values in the table. Quite a brain twister, but I did a little research and found a rather simple solution to the matter.

UPDATE: So it actually came to my atention that a query I had already tried does the job in an even simpler form, but my modelling tool executed the commands out of sync and that why i had problems. So this article stays on as a good example of how to use mysql variables.
Continue Reading »

1 Star2 Stars3 Stars4 Stars5 Stars (5 votos, média: 5.00 de 5)
Loading ... Loading ...

6 Comments »

September 18th 2006

A study on RSS – Part 2: The RSS format

In the last article I made a simple introduction to what is an RSS Feed and showed the path to creating XML files in PHP. Now it’s time to explain the RSS file structure along with some basic history.
Continue Reading »

1 Star2 Stars3 Stars4 Stars5 Stars (2 votos, média: 5.00 de 5)
Loading ... Loading ...

1 Comment »

September 15th 2006

strtotime() – is it useful?

Every now and then I get e-mails with questions that ask “How can I add X days to a given date?”, “How can I figure the day that corresponds to next thursday?”, and others along the same line. It scares me when I see replies that include enormous codes that execute innumerous function even including some bizarre leap year determination algorithms, I just can’t understand why all the complication and fuss.

The strtotime() function exists to solve these problems and i plan to introduce you to it and show a few usage examples. Also I’m going to check function performance using a simples benchmark comparison. Continue Reading »

1 Star2 Stars3 Stars4 Stars5 Stars (4 votos, média: 5.00 de 5)
Loading ... Loading ...

2 Comments »

September 1st 2006

WP Widget: BlogBlogs.com.br Favorites

After BlogBlogs released its public API, it became possible to develop plug-ins that used their data to display different information on our blogs. Using this widget its possible to retrieve you favorite blogs list, and keep it synchronized always. Continue Reading »

1 Star2 Stars3 Stars4 Stars5 Stars (5 votos, média: 4.00 de 5)
Loading ... Loading ...

11 Comments »