Wordpress从表单中插入数据不起作用

I'm developping a wordpress plugin which gets data from $_POST method and inserts these data into my database.

the plugin code is something like this :

    if(isset($_POST["name"])) $my_name = $_POST["name"];
    else $my_name = "";
    register($my_name);


function my_function( $my_name )
{

global $wpdb;
echo $my_name ;
$wpdb->get_results("insert into table_name values('".$my_name."');");
echo $my_name ;
}

this code prints the $my_name content one time only and the insert query doesn't work.

note that when i replace the query with this query the row is inserted in the database :

insert into table_name values('some text');

any help, please