Gravar dados no banco
Estou fazendo um chat, criei uma classe login para o usuário preencher seus dados quero que estes dados sejam salvo no banco, já criei a classe de conexão com o banco já teste e esta funcionando certinho, mas na hora de salvar o dados não esta salvando ele inserir o idcliente que auto incremento mas não salva os dados se alguém pode me ajudar vou colocar o código da classe e do banco.
login.php
<form action="chat.php" method="post">
<html>
<head>
<meta http-equiv="Content-Language" content="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nova pagina 1</title>
</head>
<html>
<head>
<meta http-equiv="Content-Language" content="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Nova pagina 1</title>
</head>
<body topmargin="1" leftmargin="1" rightmargin="1" bottommargin="1" marginwidth="1" marginheight="1" style="background-attachment: fixed">
<table border="3" cellpadding="0" cellspacing="0" height="534" width="450" style="border-style: double; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" bordercolor="#008000">
<!-- MSTableType="nolayout" -->
<tr>
<td valign="top" height="534" width="434">
<!-- MSCellType="ContentBody" -->
<table cellpadding="0" cellspacing="0" width="404" height="509">
<!-- MSTableType="layout" -->
<tr>
<td width="16"> </td>
<td valign="top" align="center" width="361">
<form method="POST" action="--WEBBOT-SELF--">
<p align="left">
<span style="color: rgb(0, 0, 0); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); display: inline !important; float: none;">
Para que possamos lhe prestar um bom atendimento, por favor
nos forneça algumas informações antes de começar o Chat.</span><br style="color: rgb(0, 0, 0); font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; font-style: normal; font-variant: normal; font-weight: bold; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255);">
<span class="req" style="font-size: 10px; font-weight: bold; font-family: Verdana, Arial, Helvetica, sans-serif; font-style: normal; font-variant: normal; letter-spacing: normal; line-height: 16px; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255)">
<font color="#FF0000">Itens obrigatórios indicados com *</font>.</span></p>
</form>
<form action="chat.php" method="post">
<p align="left">Seu nome:</p>
<p align="left"><input type="text" name="fnome" size="32"></p>
<p align="left">E-mail:</p>
<form method="POST" enctype="multipart/form-data" action="--WEBBOT-SELF--">
<p align="left"><input type="text" name="femail" size="32"></p>
<p align="left">Empresa:</p>
<p align="left"><input type="text" name="fempresa" size="32"></p>
<p align="left">Cidade aonde se encontra:</p>
<p align="left"><input type="text" name="fcidade" size="33"></p>
<p align="left">
<input type="submit" name="enviar" value="Entrar no Chat">
</form>
<form method="POST" action="--WEBBOT-SELF--">
</form>
<?php
require("classes.php");
require("conecta.php");
$fnome=$_POST["fnome"];
$femail=$_POST["femail"];
$fempresa=$_POST["fempresa"];
$fcidade=$_POST["fcidade"];
$sql = "insert into tbcliente (fnome,femail,fempresa,fcidade) values ('$fnome','$femail','$fempresa','$fcidade')";
mysql_query($sql,$db_conexao);
?>
</p>
<p align="left"> </p>
<p> </td>
<td height="509" width="27"> </td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
</form>
Banco
tbcliente CREATE TABLE `tbcliente` (
`idcliente` int(11) NOT NULL AUTO_INCREMENT,
`fnome` varchar(200) DEFAULT NULL,
`femail` varchar(250) DEFAULT NULL,
`fempresa` varchar(250) DEFAULT NULL,
`fcidade` varchar(200) DEFAULT NULL,
PRIMARY KEY (`idcliente`)
Agradeço desde já.
Discussão (12)
Carregando comentários...