Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //conexao
- function resultado($dados) {
- $resultados = array_fill(1, 8, 0);
- if (is_array($dados)) {
- foreach ($dados as $k => $v) {
- $resultados[$k] = $v;
- }
- } else {
- $resultados[(int)$dados] = 1;
- }
- return $resultados;
- }
- for ($i = 1; $i <= 10; $i++) {
- $temp = array($i);
- $temp = array_merge($temp, resultado($_POST['p'. $i]));
- mysql_query(vsprintf('INSERT INTO respostas VALUES (NULL, %d, %d, %d, %d, %d, %d, %d, %d, %d)', $temp));
- }
- ?>
Add Comment
Please, Sign In to add comment