I am having trouble storing the result of a query into a variable when the query returns a string. Using phpmyadmin I test the query and it definitely works. So knowing that the problem does not lie in the query. My code contains several other queries all of which work, the only difference is that they obtain their data from integer fields instead of varchar fields. This is what it stores into the string "(Ø". This is because it seems that this is the value returned by the query as when i print row[0] that is what it prints.
Included below is the problem code: sprintf(query_string, "SELECT this FROM that WHERE something = %d", var_something); if (debug) printf("%s\n", query_string); if (mysql_query(&mysql, query_string)){ if (debug) printf("ERROR"); return 1; } result = mysql_store_result(&mysql); if (mysql_num_rows(result) == 0){ printf("Error Occured\n"); return 1; } row = mysql_fetch_row(result); /*here is where I attempt to copy the string returned from the query into the variable, some of the code below is only there for debugging purposes*/ strcpy(row[0], reseller_prompts); printf("--%s--\n", row[0]); printf("--%s--\n", reseller_prompts); mysql_free_result(result); All help appreciated, Matthew --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php