Data does not appear in phpMyAdmin

Asked

Viewed 1,526 times

0

I’m having trouble sending the data passed by the form + php,and appear in the database.... When I go to phpMyadmin only the data that once I set up manual is not being dynamic to display in phpMyadmin,... Connection

$servidor = "localhost";
$user = "root";
$pass = "root";
$banco = "cadastro";


//criar conexao
$conn = mysql_connect($servidor,$user,$pass,$banco)or die(mysql_error());

 echo ("enviado com sucesso");


mysql_select_db($banco)or die(mysql_error());

The php variables

$Cobranca          = $_POST['Cobranca'];
 $Conducao          = $_POST['Conducao'];
 $conforto          = $_POST['conforto'];
 $Conservacao       = $_POST['Conservacao'];
 $CumprimentoParada = $_POST['CumprimentoParada'];
 $Distancia         = $_POST['Distancia'];
 $email             = $_POST['email'];
 $Entrega           = $_POST['Entrega'];
 $horario           = $_POST['horario'];
 $Itinérario        = $_POST['Itinérario'];
 $Limpeza           = $_POST['Limpeza'];
 $Manutencao        = $_POST['Manutencao'];
 $phone             = $_POST['phone'];
 $tCobrador         = $_POST['tCobrador'];
 $Tratamento        = $_POST['Tratamento'];
 $email             = $_POST['email'];
 $phone             = $_POST['phone'];
 $erro = 0;

Inserting in the database called all variables

$insereDados = mysql_query("INSERT INTO respostas(Cobranca,Conducao,conforto,Conservacao,CumprimentoParada)VALUES('$Cobranca','$Conducao','$conforto','$Conservacao')");
  • I think I already know what it is but it says there which is the error message that is appearing

  • something else make better use of case sensitive in their variables

  • Type,displays - echo ("successfully uploaded"); but in phpMyadmin I click select,or Update ,in the SQL part in phpMyadmin,displays the most specific #1064 error when I click update

  • I think the answer below renponde your question

1 answer

1

First problem I detected:
The parameters of your mysql_connect are not correct. You have:

$conn = mysql_connect($servidor,$user,$pass,$banco);

Though you already find deprecated the function mysql_connect just gets 3 input parameters, being them:

Server - In your case $server
User - In your case $user
Password (Optional) - In your case $pass

In his mysql_select_db is that you will select your database and then do a check whether it exists or not.

mysql_select_db($banco)
if (!$banco){
   echo "Ocorreu um erro";
}

Or you can just use the mysql_error().

Finally, in your query is missing you call your $Conn at the end of INSERT

Note: Read about mysqli. The mysql function is outdated as Miguel said. The use of this function could create serious security gaps in the systems you can develop.

  • you have a error in your sql syntax ;check the manual that corresponds to your Mysql server version for the rigth syntax to use near'[value-1],'itinerario'=[value-2] in all variables error #1064 I did everything you asked to do and displays the message sent successfully does not appear error on the page,the problem is in the bank I am not viewing ...

  • Can you put an image followed by the error ? It becomes easier to understand

Browser other questions tagged

You are not signed in. Login or sign up in order to post.