Jump to content
Fórum Script Brasil
  • 0

Me Ajudem Com Esse Codigo.


)O(COMAND)O(

Question

/*Ele da erro no último:

$result = mysql_query($sqlcons,$conec);

e não inclui o registro */

********************************************************************

<?

$nome;

$desc;

$conec;

$bco;

$sqlcons;

$nome = $_POST['nome'];

$desc = $_POST['desc'];

$conec = mysql_connect('localhost','root','');

if ($conec) {

echo "Conectado<br>";

}

else {

echo "Não Conectado<br>";

}

$bco = mysql_select_db("velas",$conec);

if ($bco) {

echo "DB Encontrado<br>";

}

else {

echo "DB Não Encontrado<br>";

}

$sqlcons = "INSERT INTO estoque ('nome','desc') VALUES ('$nome','$desc')";

if ($sqlcons) {

echo "SQL Executado<br>";

}

else {

echo "SQL Não Executado<br>";

}

$result = mysql_query($sqlcons,$conec);

if ($result){

echo "Sucesso!<br>";

}

else {

echo "Erro!" ;

}

?>

********************************************************************

Resultado HTML

Conectado

DB Encontrado

SQL Executado

Erro!

Link to comment
Share on other sites

2 answers to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



  • Forum Statistics

    • Total Topics
      152.2k
    • Total Posts
      651.8k
×
×
  • Create New...