Ir para conteúdo
Fórum Script Brasil

Raymundofsa

Membros
  • Total de itens

    2
  • Registro em

  • Última visita

Sobre Raymundofsa

Raymundofsa's Achievements

0

Reputação

  1. Mas eu to precisando gravar no banco as imagens. o Script do banco é : CREATE TABLE `produto` ( `idproduto` int(10) unsigned NOT NULL AUTO_INCREMENT, `descricao` varchar(50) DEFAULT NULL, `qtd` decimal(10,2) DEFAULT NULL, `valor` decimal(10,2) DEFAULT NULL, `des_imagem` varchar(50) DEFAULT NULL, `imagem` blob, `categoria` varchar(50) DEFAULT NULL, `tipo` varchar(25) DEFAULT NULL, PRIMARY KEY (`idproduto`) ) ENGINE=MyISAM AUTO_INCREMENT=47 DEFAULT CHARSET=latin1;
  2. Gente por favor me ajudem. Eu não to coneguindo fazer esse codigo gravar uma ficha de cadastro de produtos com uma ft do produto. Por favor me ajudem Segue o codigo: <?php $conexao = @mysql_connect("localhost","root",""); if(!$conexao) echo"<br>A conexao não foi realizada, erro numero: ".mysql_errno().", nome do erro.:".mysql_error(); else $conecta_banco = mysql_select_db("sisweb",$conexao); $sql_insere = "insert into produto (descricao, qtd, valor, des_imagem, categoria, tipo, imagem) values ('$nome', $qtd, $vlr, '$inftec', '$categoria', '$tipo', '$file' )"; $resultado = mysql_query($sql_insere); ?> <html> <head> <title>Cadastro de Produtos</title> </head> <body bgcolor="#00CCFF"> <form name="cadastro" method="post" enctype="multipart/form-data" action="cad_produtos.php"> <table width="1317" border="1"> <tr> <td width="73">Nome:</td> <td width="1243"><input type="text" name="nome" size="205" $_POST['nome']/></td> </tr> <tr> <td width=73">Inf.Tecnica:</td> <td><textarea name="inftec" rows="4" cols="202" $_POST['inftec]></textarea></td> </tr> <tr> <td width="73">categoria:</td> <td><input type="text" name="categoria" size="205" $_POST['categoria'] /></td> </tr> <tr> <td width=73">Tipo:</td> <td><input type="text" name="tipo" size="205" $_POST['tipo] /></td> </tr> <tr> <td width="73">Quantidade:</td> <td><input type="text" name="qtd" size="205" $_POST['qtd'] /></td> </tr> <tr> <td width=73">Valor:</td> <td><input type="text" name="vlr" size="205" $_POST['vlr] /></td> </tr> <tr> <td>Imagem</td> <td><input type="file" name="file" id="fie" $_FIlES['file'] /></td> </tr> <tr> <td align=center"><input type="submit" id="cadastro" value="Confirmar" size="100"/></td> </tr> </table> </form> <table width="1316" height="152" border="3" bgcolor="#FFFFFF"> <tr> <td colspan="8" align="center">Tabela de Produtos Cadastrados</td> </tr> <tr> <td width="295" height="33" align="center" border="2">Codigo:</td> <td width="295" align="center" border="2">Nome:</td> <td width="213" align="center" border="2">Inform. Tecnica:</td> <td width="125" align="center" border="2">Categoria:</td> <td width="113" align="center" border="2">Tipo:</td> <td width="122" align="center" border="2">Quantidade:</td> <td width="314" align="center" border="2">Valor:</td> <td width="314" align="center" border="2">Imagem:</td> </tr> <?php require '../conexao/conecta_php.php'; $sql_select = "select * from produto"; $sql_selectmax = "select count(*)as max from produto"; $resultado = mysql_query($sql_select); $soma = mysql_query($sql_selectmax); while($registros = mysql_fetch_array($resultado)) { ?> <tr> <td height="50"><div align="center"> <?php echo $registros['idproduto] ?> </td> <td width="20%"><div align="center"> <?php echo $registros['descricao'] ?> </td> <td width=20%"><div align="center"> <?php echo $registros['des_imagem] ?> </td> <td width="20%"><div align="center"> <?php echo $registros['categoria'] ?> </td> <td width=20%"><div align="center"> <?php echo $registros['tipo] ?> </td> <td width="20%"><div align="center"> <?php echo $registros['qtd'] ?> </td> <td width=20%"><div align="center"> <?php echo $registros['valor] ?> </td> <td width="20%"><div align="center"> <?php echo $registros['imagem'] ?></td> </tr> <?php }?> </body> </html>
×
×
  • Criar Novo...