Guest nicholas aguiar dias Posted June 23, 2004 Report Share Posted June 23, 2004 Por que não Deleta o registro..alguém pode me ajudar.?o que esta de errado<?php// conectar mysql$conectar_banco = mysql_connect('localhost','root');// Conectar Bancomysql_select_db('banco');//Pega a variavel do formulario $user_db = $HTTP_POST_VARS["user_form"];$pass_db = $HTTP_POST_VARS["pass_form"];/* Seleciona a tabela */$select = mysql_query("SELECT * FROM as_login_db WHERE user=$user_db' AND pass='$pass_db' ");if( $row = @mysql_fetch_array($select) ){$user_txt = $row['user];{/* Deleta os campos de login,senha e url */$wsql =("DELETE FROM as_login_adm WHERE user='nicholas' AND pass='sbla4598' ");mysql_query($wsql); print("<br><br><center>Usuário deletado com sucesso</center>"); }else{print("<br><br><center>Este usuário não existe</center>");}exit;?> Quote Link to comment Share on other sites More sharing options...
0 Error404 Posted June 23, 2004 Report Share Posted June 23, 2004 Mostra algum erro?ps: coloca os códigos dentro das tags de code ou quote... fica melhor de ler... Quote Link to comment Share on other sites More sharing options...
0 Fabyo Posted June 23, 2004 Report Share Posted June 23, 2004 Tenta assim:/Pega a variavel do formulario $user_db = $_POST["user_form"];$pass_db = $_POST["pass_form"];/* Seleciona a tabela */$select = mysql_query("SELECT * FROM as_login_db WHERE user=$user_db' AND pass='$pass_db' ");if( $row = @mysql_fetch_array($select) ){$id = $row["id];$user_txt = $row['user'];{/* Deleta os campos de login,senha e url */$wsql =("DELETE FROM as_login_adm WHERE id = '$id'");mysql_query($wsql); print("<br><br><center>Usuário deletado com sucesso</center>"); } Quote Link to comment Share on other sites More sharing options...
Question
Guest nicholas aguiar dias
Por que não Deleta o registro..
alguém pode me ajudar.?
o que esta de errado
<?php
// conectar mysql
$conectar_banco = mysql_connect('localhost','root');
// Conectar Banco
mysql_select_db('banco');
//Pega a variavel do formulario
$user_db = $HTTP_POST_VARS["user_form"];
$pass_db = $HTTP_POST_VARS["pass_form"];
/* Seleciona a tabela */
$select = mysql_query("SELECT * FROM as_login_db WHERE user=$user_db' AND pass='$pass_db' ");
if( $row = @mysql_fetch_array($select) ){
$user_txt = $row['user];
{
/* Deleta os campos de login,senha e url */
$wsql =("DELETE FROM as_login_adm WHERE user='nicholas' AND pass='sbla4598' ");
mysql_query($wsql);
print("<br><br><center>Usuário deletado com sucesso</center>");
}
else
{
print("<br><br><center>Este usuário não existe</center>");
}
exit;
?>
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.