This is the following I have a variable in php that is the shift that this way (15: 00-16: 00) which represents the hours what I want is to take that variable and insert it into the database separately , that is, get in:
$variavel="15:00-16:00";
and insert like this:
$variavelhora1="15:00";
$variavelhora2="16:00";
Code:
$inserir_turno = nl2br(addslashes($_POST['inserir_turno']));
$query = sprintf("INSERT INTO trabalho (turno,variavelhora1,variavelhora2) values ('%s','%s','%s')", $inserir_turno, $variavelhora1, $variavelhora2);
$pv = mysql_query($query);
Can anyone help me?