首页 \ 问答 \ 检查删除是否成功消息php ajax jquery mysql(check if delete was successful message php ajax jquery mysql)

检查删除是否成功消息php ajax jquery mysql(check if delete was successful message php ajax jquery mysql)

嗨大家甚至我有成功删除消息返回错误删除消息(“无法删除”)除了成功删除消息但查询是wokrking请告诉我,我做错了这里是我的代码\

delete.php

  if(isset($_POST['delete_id']) && !empty($_POST['delete_id'])) {
          $delete_id = mysql_real_escape_string($_POST['delete_id']);
    $query=mysql_query("DELETE FROM color WHERE idColor='$delete_id'");
    if($query != false) {
            echo 'true';
          }
    mysql_close();
<script>
 $(document).ready(function(){
        $('.del_btn').click(function(){
        if (confirm("Are you sure you want to delete this Color?"))
       var del_id = $(this).attr('rel');
              $.post('script/delete_color.php', {delete_id:del_id}, function(data) {
          if(data == 'true') {
            $('#'+del_id).remove();alert('Color has been deleted!');
          }
           else {
            alert('Color could not delete!');
          }
                document.messages.submit();
            return false; // This line added}
    });
    }); 
    });

</script>

hi guys even i have success delete the message return false delete message("could not delete") besides success delete messege but query is wokrking please tell me what i am doing wrong here is my codes \

delete.php

  if(isset($_POST['delete_id']) && !empty($_POST['delete_id'])) {
          $delete_id = mysql_real_escape_string($_POST['delete_id']);
    $query=mysql_query("DELETE FROM color WHERE idColor='$delete_id'");
    if($query != false) {
            echo 'true';
          }
    mysql_close();
<script>
 $(document).ready(function(){
        $('.del_btn').click(function(){
        if (confirm("Are you sure you want to delete this Color?"))
       var del_id = $(this).attr('rel');
              $.post('script/delete_color.php', {delete_id:del_id}, function(data) {
          if(data == 'true') {
            $('#'+del_id).remove();alert('Color has been deleted!');
          }
           else {
            alert('Color could not delete!');
          }
                document.messages.submit();
            return false; // This line added}
    });
    }); 
    });

</script>

原文:https://stackoverflow.com/questions/8611037
更新时间:2023-08-22 07:08

最满意答案

在Scheme中,您可以定义这样的函数

 (define (foo bar)
    ...)

要么

  (define foo
     (lambda (bar)
         ...))

但是你已经完成了两个,所以你的程序返回另一个程序:( (lambda (midtermWeight)...你必须再次使用midtermweight调用它来获得结果。


In Scheme, you can define a function like this

 (define (foo bar)
    ...)

or

  (define foo
     (lambda (bar)
         ...))

But you've done both so you're procedure returns another procedure: (lambda (midtermWeight).... You'll have to call it again with the midtermweight to get a result.

相关问答

更多
  • 就是这样: 正如您发现的那样,点击“运行”按钮 按Esc + p 这是文档中的相关页面。 Here's how: Click on the "run" button, as you discovered Press Esc + p And this is the relevant page in the documentation.
  • 球拍最终基于R5RS,而不是R6RS,而不是严格的超集。 我不认为这可以称为“计划”,因为它不符合任何方案标准。 大多数实现提供扩展,但是否则向后兼容,当然,Racket附带的编译器也可以在R5RS或R6RS模式下运行。 运行在球拍模式下的有效的R5 / 6RS方案可能会被拒绝,导致运行时错误或者与其应用不同的行为。 就这样说,它不是向后兼容的要点是: 球拍没有set-cdr! 和set-car! ,而是set-mcar! 它只适用于专门创建为可变的对。 Racket调用letrec在R6RS中称为letr ...
  • 尝试 $str = "My name is Ayman. I'm 31 years. I'm 1.92M. I have BSc. degree in Computer Engineering"; $str = preg_split("/([\?\!\.]+)(?=\s+[A-Z])/",$str); foreach($str as $new_str) { echo $new_str.".
    "; } 产量 My name is Ayman. I'm 31 years. I'm 1.9 ...
  • Chris Jester-Young的评论是正确的:不要使用R5RS。 在标准的R5RS语言中,没有模块这样的东西。 去看看http://www.schemers.org/Documents/Standards/R5RS/ ; 不是关于模块的话,对吧? 球拍比标准更严肃地对待标准:如果你让它在R5RS模式下工作,它将关闭标准没有描述的语言功能。 如果您使用的是Racket工具链,请不要使用R5RS语言,除非您确实想要使用限制性语言。 改为使用标准的#lang racket 。 请参阅: http : //d ...
  • 如果您在DrRacket中执行程序,您将获得错误消息,并明确证明其原因: 你看到问题在里面: ((remove (first list-b) list-a) (rest list-b))) 原因是在方案中你不能像其他语言一样自由使用括号: (+ 2 (+ 3 4))不等于(+ 2 ((+ 3 4))) :第一个表达式被计算为9,第二个给出错误,因为((+ 3 4))以这种方式解释: 评估内部形式(表达式) (+ 3 4) ,即将操作+应用于参数3和4,生成7。 由于(+ 3 4)在另一组括号内,因此得到结 ...
  • 答案取决于你是否想要循环 - 处理它们会使事情复杂化。 但是如果你想只用列表进行表示,那么shared就是你的朋友。 例如: (shared ([NY (list "NY" (list London Paris))] [Paris (list "Paris" (list NY))] [London (list "London" (list NY))]) (list NY Paris London)) 如果您的目标是实际编写“真实”代码,那么使用您 ...
  • 为什么不直接向控制台输出异常? (with-handlers ([exn:fail? displayln]) (car 17)) => #(struct:exn:fail:contract car: contract violation expected: pair? given: 17 #) Why not just print the exception to the console? (with-handlers ([exn:fail ...
  • 在Scheme中,您可以定义这样的函数 (define (foo bar) ...) 要么 (define foo (lambda (bar) ...)) 但是你已经完成了两个,所以你的程序返回另一个程序:( (lambda (midtermWeight)...你必须再次使用midtermweight调用它来获得结果。 In Scheme, you can define a function like this (define (foo bar) .. ...
  • 当您要关闭的选项卡处于活动状态时,您可以在菜单中选择“文件 - >关闭”或使用键盘快捷键Ctrl + W将其关闭。 While the tab you want to close is active, you can either select "File -> Close" in the menu or use the keyboard shortcut Ctrl+W to close it.
  • 您可以使用member过程和可能的选项列表实现您想要的效果: member找到lst的第一个元素是否相等? 如果存在这样的元素,则返回以该元素开头的lst的尾部。 否则,结果是#f。 这就是我的意思: (define (conversation input) (cond ((member input '("hello Racket" "hi Racket" "what's up, Racket?" "hey Racket" "what's happeni ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)