Hello im makin a program in C tht will query my database
when i use the following code i get an error "segmentation fault"

//retreive configuration items from the mysql database
 mysql_query(conn, "SELECT callcost FROM imds.testset Where callcost BeTWEEN 900 and 1000;");
 results = mysql_store_result(conn);

even when i use SUM, AVG and Count, but when i use

//retreive configuration items from the mysql database
 mysql_query(conn, "SELECT * FROM imds.testset Where callcost BeTWEEN 900 and 1000;");
 results = mysql_store_result(conn);

i get no errors at all.
what could be causin this error?
thnx