2
This is the following I have a variable in php that is the turn that this way (15:00-16:00) that represents the hours what I want is to take this variable and insert it into the database separately, ie, take:
$variavel="15:00-16:00";
and so insert:
$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);
pff someone can help me?
Thank you! Happy New Year
– Shider
Just fixing the friend @lffg, no explode change the bar by hyphen, getting
$turno_separado = explode('-', $turno);
.– Thiago
Oops, it’s true. I already edited above. Thanks for the remark, Thiago. :)
– Luiz Felipe
I noticed but it wasn’t important
– Shider