Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/267.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php ajax成功功能不工作,但在firebug控制台中显示_Php_Javascript_Jquery_Html_Ajax - Fatal编程技术网

Php ajax成功功能不工作,但在firebug控制台中显示

Php ajax成功功能不工作,但在firebug控制台中显示,php,javascript,jquery,html,ajax,Php,Javascript,Jquery,Html,Ajax,我正在创建简单的搜索 这在不使用ajax的情况下是完美的,我使用ajax做到了这一点 在firebug控制台中显示响应数组,但在ajax成功函数中不会触发数据。为什么 PHP代码 <?php include('RO_dbconfig.php'); $search =$_GET['search']; $sql=$dbconnect->prepare("SELECT student_name FROM student_reg WHERE reg_id='$search'"); $sq

我正在创建简单的搜索

这在不使用ajax的情况下是完美的,我使用ajax做到了这一点

在firebug控制台中显示响应数组,但在ajax成功函数中不会触发数据。为什么

PHP代码

<?php 
include('RO_dbconfig.php');
$search =$_GET['search'];

$sql=$dbconnect->prepare("SELECT student_name FROM student_reg WHERE reg_id='$search'");
$sql->execute();

$result=$sql->fetchALL();
var_dump($result);    
?>
HTML

<form id="searchForm" class="form-horizontal">
  <div class="control-group">
    <label class="control-label label_al" for="inputStNum">Student No:</label>

  <div class="input-append">
    <input type="text" id="searchText" class="span2 span11" name="search">
    <input type="submit" id="serachSubmit" class="btn buttnn" value="Search"/>
  </div>
  </form>

学号:

拼写错误


请查看您的ajax代码,而不是
succuss:function(e){
write
success:function(e){

请查看您的ajax代码。它有一个关于succuss的拼写错误。实际上它将是success

AJAX

你这里有打字错误

替换

succuss:function(e)


它应该是
success
而不是
succuss
succuss
=>
success
:facepalm:用于upvoter。
$("#serachSubmit").click(function(event){
event.preventDefault();
var data =$("#searchForm").serialize();
//$("#response").html(data);
$.ajax({            
    type:"GET",
    url:"search.php",
    data:data,

    success:function(e){
        alert(e);

        }           
    });     
});
succuss:function(e)
 success:function(e)