I am developing one custom module in drupal 7 like a registration form all things are worked correctly but i cannot insert the records in my db_table. I am using the following code in drupal 7
function reg_fields_form_submit($form,&$form_state){
$name = trim($form_state['values']['name']);
$phone = trim($form_state['values']['phone']);
$email = trim($form_state['values']['email']);
$query = "INSERT INTO {registration} (name,phone,email) VALUES ('%s', '%s', '%s')";
$result = db_query($query, array($name, $phone, $email));
if ($result !== FALSE){
drupal_set_message('data saved successfully.');}
but in my table inserted values are like %S,%S,%S in everytime how can fix this issue.and also i want to display the inserted values in to same page. Any one help me