Ir para conteúdo
Fórum Script Brasil

lfelipecoutinho

Membros
  • Total de itens

    1
  • Registro em

  • Última visita

Sobre lfelipecoutinho

lfelipecoutinho's Achievements

0

Reputação

  1. Caros,Sou novo no forum e também não sou um desenvolvedor. Estou, com a ajuda do Dreamweaver, tentando criar um protótipo de sistema web based para então repassar a demanda ao TI. Sei dos problemas encontrados com o MY de mysql com mysqli, mas para alguém sem experiência o suporte do DW é importante, e como quero criar algo simples que sirva de exemplo acho que passar por estes inconvenientes na marra e com a ajuda de vocês será a forma mais rápida. Segue abaixo o erro e o coódigo. Antecipadamente grato, Erro: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'clientes (cli_Nome, cli_CNPJ, cli_Telefone, cli_endereço, cli_responsavel, cli_' at line 1Code:<?php require_once('Connections/conexao.php'); ?><?php$hostname_conexao = "localhost";$database_conexao = "urbanforo";$username_conexao = "root";$password_conexao = "paizao10";$conexao = mysqli_connect($hostname_conexao, $username_conexao, $password_conexao,$database_conexao);if (!function_exists("GetSQLValueString")) {function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") {if (PHP_VERSION < 6) {$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;}$theValue = function_exists("mysql_real_escape_string") ? mysqli_real_escape_string(dbconnect(),$theValue) : mysqli_escape_string(dbconnect(),$theValue);switch ($theType) {case "text":$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";break; case "long":case "int":$theValue = ($theValue != "") ? intval($theValue) : "NULL"; break;case "double":$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";break;case "date":$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";break;case "defined":$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;break;}return $theValue;}}$editFormAction = $_SERVER['PHP_SELF'];if (isset($_SERVER['QUERY_STRING'])) {$editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);}if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form1")) {$insertSQL = sprintf("INSERT INTO cadastro clientes (cli_Nome, cli_CNPJ, cli_Telefone, cli_endereço, cli_responsavel, cli_e-mail, cli_senha) VALUES (%s, %s, %s, %s, %s, %s, %s)",GetSQLValueString($_POST['cli_Nome'], "text"),GetSQLValueString($_POST['cli_CNPJ'], "int"),GetSQLValueString($_POST['cli_Telefone'], "int"),GetSQLValueString($_POST['cli_endereo'], "text"),GetSQLValueString($_POST['cli_responsavel'], "text"),GetSQLValueString($_POST['cli_email'], "text"),GetSQLValueString($_POST['cli_senha'], "text"));mysqli_select_db($conexao,$database_conexao);$Result1 = mysqli_query($conexao,$insertSQL) or die(mysqli_error($conexao));$insertGoTo = "sucesso.php";if (isset($_SERVER['QUERY_STRING'])) {$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";$insertGoTo .= $_SERVER['QUERY_STRING'];}header(sprintf("Location: %s", $insertGoTo));}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Untitled Document</title></head><body><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>Cadastro Clientes</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><form action="<?php echo $editFormAction; ?>" method="post" name="form1" id="form1"><table align="center"><tr valign="baseline"><td nowrap="nowrap" align="right">Nome:</td><td><input type="text" name="cli_Nome" value="" size="32" /></td></tr><tr valign="baseline"><td nowrap="nowrap" align="right">CNPJ:</td><td><input type="text" name="cli_CNPJ" value="" size="32" /></td></tr><tr valign="baseline"><td nowrap="nowrap" align="right">Telefone:</td><td><input type="text" name="cli_Telefone" value="" size="32" /></td></tr><tr valign="baseline"><td nowrap="nowrap" align="right">Endereço:</td><td><input type="text" name="cli_endereo" value="" size="32" /></td></tr><tr valign="baseline"><td nowrap="nowrap" align="right">Responsavel:</td><td><input type="text" name="cli_responsavel" value="" size="32" /></td></tr><tr valign="baseline"><td nowrap="nowrap" align="right">E-mail:</td><td><input type="text" name="cli_email" value="" size="32" /></td></tr><tr valign="baseline"><td nowrap="nowrap" align="right">Senha:</td><td><input type="text" name="cli_senha" value="" size="32" /></td></tr><tr valign="baseline"><td nowrap="nowrap" align="right">&nbsp;</td><td><input type="submit" value="Insert record" /></td></tr></table><input type="hidden" name="MM_insert" value="form1" /></form><p>&nbsp;</p></body></html>
×
×
  • Criar Novo...