Showing posts with label mysql. Show all posts
Showing posts with label mysql. Show all posts

Wednesday, October 3, 2012

How NOT to design a messageboard

Goddammit, everything about MySQL sucks serious sackage. Have you ever googled for a MySQL issue and clicked a link for anything related to mysql.com? The whole site is designed to be incredibly painful and user-hostile.

Nice messageboard, MySQL.
Nice documentation, MySQL
Nice Homepage, MySQL.
Nice forums, MySQL.

DO YOU BASTARDS FUCKING TEST ANYTHING??

Seriously, just because things exist (forums, docs etc) doesn't mean they need to be changed.

Holy fucking shit MySQL, look at what SQLite did! An easy to read flowchart! Clear documentation! Who'da thunk it.

I fucking hate MySQL.

Tuesday, October 2, 2012

Lazy mysql

I fucking hate MySQL.

is it just me or do the letters 'sql' take far too long to type? They are in complete opposite ends of the keyboard and chafe my ass. Add in 'my' and you now have a word that requires you visit all compass points of your keyboard to type it. What's worse, every mysql function in php has "mysql" at the start of it!

Because I am a lazy bastard I made a little function that eases my pain.

function fetch($str){
    $q = mysql_query($str);
    $a = mysql_fetch_assoc($q);
    if(!$a){
         echo 'e: Fetch() returned an error! '.mysql_error();
         return false;
    }
    else return $a;
}

Now I can just call fetch("SELECT * FROM `my_ass` WHERE `mysql` = 'shit'"); whenever I require an array from a mysql string. I don't have to type "mysql" once!

Seriously, try typing mysql ten times fast.

Friday, December 2, 2011

Reserved words in Mysql

Here's a quick one for anyone who has a query that just won't work (insert and update in particular). Mysql reserves certain words for its own uses. One such word (and the reason for this post) is 'desc'. An oft used abbreviation for 'description', 'desc' recently caused me three hours of confusing, frustrating code rewrites and function restructuring. Turns out naming a column 'desc' is a right reserved for mysql, and if you try it mysql will not tell you about it, just imply a syntax error. Mysql hogs 'desc' and other common names. Seems a bit selfish to me.

Just out of interest, here's a list of mysql reserved words that you should keep handy in case of an insolvable refusal of your query.

I fucking hate mysql.