Well, this is the following I have an array called $ posts, this $ posts array is an array that contains several things, such as: Work, Dinner, Home, Away.
What do I want to do a select to a table in the database where posto = $ posts, that is to all the results, that are in the array?
How can I do this?
Thank you.
@EDIT:
echo $postosstring;
$procura1 = mysqli_query($link, "SELECT * FROM faturacoes where Status = 1 AND Data >= '$datainicial' AND Data <= '$datafinal' AND posto IN ('.$postosstring.')");
// Total Contratos
$resultset1 = mysqli_query($link, "SELECT SUM(contratos) as contratos FROM faturacoes where status='1' AND Data >= '$datainicial' AND Data <= '$datafinal' AND posto IN ('.$postosstring.')");
$linha1= mysqli_fetch_assoc($resultset1);
$soma1 = $linha1['contratos'];
// Total Valor
$resultset2 = mysqli_query($link, "SELECT SUM(valor) as valor FROM faturacoes where Status = 1 AND Data >= '$datainicial' AND Data <= '$datafinal' AND posto IN ('.$postosstring.')");
$linha2= mysqli_fetch_assoc($resultset2);
$soma2 = $linha2['valor'];
My SELECT is not working.