1. why mysql comes out a problem with "release mode", say not start with "/"
2. why when there is directory, there may be problem with compling
Showing posts with label MySQL. Show all posts
Showing posts with label MySQL. Show all posts
Sunday, November 11, 2007
Saturday, November 10, 2007
Some notes on MySQL
1. how to check whether a field is NULL?
First, NULL in MySQL is not a value, it is a condition. So if you try and write something "= NULL" you'll get an empty set rather than the results you're looking for. Try "IS NULL" instead. For example, mysql> select * from demo_people left join demo_property on demo_people.pid = demo_property.pid where spid is NULL;
2. becaulful with this code:
while((row=mysql_fetch_row(res)))
{
for(int j=0;j {
printf("%s ",row[j]);
}
printf("\n");
}
if the MySQL query get a tuple whchi has field "NULL", then problem comes!
First, NULL in MySQL is not a value, it is a condition. So if you try and write something "= NULL" you'll get an empty set rather than the results you're looking for. Try "IS NULL" instead. For example, mysql> select * from demo_people left join demo_property on demo_people.pid = demo_property.pid where spid is NULL;
2. becaulful with this code:
while((row=mysql_fetch_row(res)))
{
for(int j=0;j
printf("%s ",row[j]);
}
printf("\n");
}
if the MySQL query get a tuple whchi has field "NULL", then problem comes!
Thursday, November 8, 2007
Fulltext Search in MySQL
There are some points I encountered during my experiements:
1. how to change ft_min_word_len for windows platform: add one line ft_min_word_len = 2 in my.ini file in MySQL installment directory
2. After we changed the ft_min_word_len variable, we have to rebuild the fulltext index by ALTER TABLE person ADD FULLTEXT(name)
1. how to change ft_min_word_len for windows platform: add one line ft_min_word_len = 2 in my.ini file in MySQL installment directory
2. After we changed the ft_min_word_len variable, we have to rebuild the fulltext index by ALTER TABLE person ADD FULLTEXT(name)
Subscribe to:
Posts (Atom)