gunnarcorrea
(usa Ubuntu)
Enviado em 09/10/2012 - 18:45h
Esta funcionando a Conexão, porém ainda não insere os dados.
olha todo o código PHP.
<?php
//Valor Primários
$titulo = $_POST[titulo];
$disponibilidade = $_POST[disponibilidade];
$categoria = $_POST[categoria];
$valor = $_POST[valor];
//Texto 1
$texto1 = $_POST[content2];
//Perguntas e Respostas
$per11 = $_POST[per11];
$res11 = $_POST[res11];
$val11 = $_POST[val11];
$res12 = $_POST[res12];
$val12 = $_POST[val12];
$res13 = $_POST[res13];
$val13 = $_POST[val13];
$per12 = $_POST[per12];
$res21 = $_POST[res21];
$val21 = $_POST[val21];
$res22 = $_POST[res22];
$val22 = $_POST[val22];
$res23 = $_POST[res23];
$val23 = $_POST[val23];
$per31 = $_POST[per31];
$res31 = $_POST[res31];
$val31 = $_POST[val31];
$res32 = $_POST[res32];
$val32 = $_POST[val32];
$res33 = $_POST[res33];
$val33 = $_POST[val33];
$per41 = $_POST[per41];
$res41 = $_POST[res41];
$val41 = $_POST[val41];
$res42 = $_POST[res42];
$val42 = $_POST[val42];
$res43 = $_POST[res43];
$val43 = $_POST[val43];
$per51 = $_POST[per51];
$res51 = $_POST[res51];
$val51 = $_POST[val51];
$res52 = $_POST[res52];
$val52 = $_POST[val52];
$res53 = $_POST[res53];
$val53 = $_POST[val53];
//Texto 2
$texto2 = $_POST[content];
//Perguntas e Respostas
$per011 = $_POST[per011];
$res011 = $_POST[res011];
$val011 = $_POST[val011];
$res012 = $_POST[res012];
$val012 = $_POST[val012];
$res013 = $_POST[res013];
$val013 = $_POST[val013];
$per012 = $_POST[per012];
$res021 = $_POST[res021];
$val021 = $_POST[val021];
$res022 = $_POST[res022];
$val022 = $_POST[val022];
$res023 = $_POST[res023];
$val023 = $_POST[val023];
$per031 = $_POST[per031];
$res031 = $_POST[res031];
$val031 = $_POST[val031];
$res032 = $_POST[res032];
$val032 = $_POST[val032];
$res033 = $_POST[res033];
$val033 = $_POST[val033];
$per041 = $_POST[per041];
$res041 = $_POST[res041];
$val041 = $_POST[val041];
$res042 = $_POST[res042];
$val042 = $_POST[val042];
$res043 = $_POST[res043];
$val43 = $_POST[val043];
$per051 = $_POST[per051];
$res051 = $_POST[res051];
$val051 = $_POST[val051];
$res052 = $_POST[res052];
$val052 = $_POST[val052];
$res053 = $_POST[res053];
$val053 = $_POST[val053];
if (isset($_POST[titulo])){
include"config.php";
$insert = "INSERT INTO materia
(id, titulo, disponibilidade, categoria, valor, texto1,
per11, res11, val11, res12, val12, res13, val13,
per12, res21, val21, res22, val22, res23, val23,
per31, res31, val31, res32, val32, res33, val33,
per41, res41, val41, res42, val42, res43, val43,
per51, res51, val51, res52, val52, res53, val53, texto2,
per011, res011, val011, res012, val012, res013, val013,
per012, res021, val021, res022, val022, res023, val023,
per031, res031, val031, res032, val032, res033, val033,
per041, res041, val041, res042, val042, res043, val043,
per051, res051, val051, res052, val052, res053, val053) VALUES
('', '$titulo', '$disponibilidade', '$categoria', '$valor', '$texto1', '$per11', '$res11', '$val11', '$res12', '$val12', '$res13', '$val13',
'$per12', '$res21', '$val21', '$res22', '$val22', '$res23', '$val23',
'$per31', '$res31', '$val31', '$res32', '$val32', '$res33', '$val33',
'$per41', '$res41', '$val41', '$res42', '$val42', '$res43', '$val43',
'$per51', '$res51', '$val51', '$res52', '$val52', '$res53', '$val53', '$texto2',
'$per011', '$res011', '$val011', '$res012', '$val012', '$res013', '$val013',
'$per012', '$res021', '$val021', '$res022', '$val022', '$res023', '$val023',
'$per031', '$res031', '$val031', '$res032', '$val032', '$res033', '$val033',
'$per041', '$res041', '$val041', '$res042', '$val042', '$res043', '$val043',
'$per051', '$res051', '$val051', '$res052', '$val052', '$res053', '$val053')";
include"config.php";
$mysql = mysql_query($insert);
echo "<script type=\"text/javascript\">alert('Correto'); </script>;";
}else{}
?>