MySQL fulltext search always empty

If you’ve just switched to FULLTEXT indexes and you’ve just started playing with MATCH… AGAINST syntax, but you always get 0 rows results, probably you’re not crazy, and no, it isn’t a mysql bug. There are some common mistakes that developers make: MYSQL FULLTEXT INDEX ERRORS 1 – check if you’re searching short words, by […]

How to remove custom fields from WordPress

Ok. You’ve added custom fields in wordpress, but how can you remove them? How to delete custom fields wordpress Two ways: 1) open your phpMyAdmim and search in the wp_postmeta table all the records that match your custom field name in the “meta_key” field and delete them. You can do a query like this: Just […]

13 mysql tips that you don’t know

Here is a list of thirteen tips that can be usefull for your queries. If you know more tips send comments. 1 REMAP VALUES INSIDE A QUERY USING CASE…WHEN SYNTAX 2 FIND DUPLICATE RECORDS WITH EMAIL FIELD 3 EXTRACT RECORDS WITH A RANDOM ORDER 4 REPLACE STRINGS IN A FIELD WITH AN UPDATE 5 RESET […]

10 PHP usefull functions for MySQL stuff

Here is my personal collection of 10 php function that I always include in my database function library. I think they are very usefull and I’d like to share with you. Here are the mysqli versions of the functions. (NEW) FUNCTION 1: CONNECT TO A DB Connect function. I know, everybody already has this function […]

MYSQL add counter in a query

Sometimes I’ve needed to add a counter column in a query and I don’t want to add the column with php, so I’ve found this query to put the counter directly in the record set returned out from the query. To use it in PHP scripts you have to use 2 query statements:

Stop UTF8 problems with special characters

I’m italian and I always need to use special chars like è é à ù. The same need belongs to french developers, and many other non-english developers. To use special chars without encoding problems try to follow this 4 rules: create fields on db with utf8_general_ci collation make the query ‘set names’ after any connection […]