Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/358.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
Java 可以显示表格搜索数据。。。搜索功能正常。。。显示错误 错误是什么$('searchform')此处缺少#。从搜索功能检索到的数据无法显示在关键字文本框下方 <in search.php> <?php require_once(".._Java_Php_Jquery - Fatal编程技术网

Java 可以显示表格搜索数据。。。搜索功能正常。。。显示错误 错误是什么$('searchform')此处缺少#。从搜索功能检索到的数据无法显示在关键字文本框下方 <in search.php> <?php require_once("..

Java 可以显示表格搜索数据。。。搜索功能正常。。。显示错误 错误是什么$('searchform')此处缺少#。从搜索功能检索到的数据无法显示在关键字文本框下方 <in search.php> <?php require_once("..,java,php,jquery,Java,Php,Jquery,可以显示表格搜索数据。。。搜索功能正常。。。显示错误 错误是什么$('searchform')此处缺少#。从搜索功能检索到的数据无法显示在关键字文本框下方 <in search.php> <?php require_once("../includes/session.php"); ?> <?php require_once("../includes/connection.php") ?> <?php require_once("../include

可以显示表格搜索数据。。。搜索功能正常。。。显示错误


错误是什么
$('searchform')
此处缺少
#
。从搜索功能检索到的数据无法显示在关键字文本框下方
<in search.php>


<?php require_once("../includes/session.php"); ?>
<?php require_once("../includes/connection.php") ?>
<?php require_once("../includes/functions.php") ?>
<?php

$searchq = $_POST['searchq'];
$tablehead="<tr><th>Product Name</th><th>Category</th><th>Price</th><th>Discount</th><th>Edit</th></tr>";
$tabledata = "";
if(empty($searchq)) {
    echo "";
    } else {
    //If there is text in the search field, this code is executed every time the input changes.
    echo "<div id='results'-->"; //this div is used to contain the results. Mostly used for styling.

    //This query searches the name field for whatever the input is.
    $sql = "SELECT * FROM `tblstudent` WHERE `student_id` LIKE '%$searchq%' or `name` LIKE '%$searchq%' or `email` LIKE '%$searchq%'";

    $result = mysql_query($sql);

    while($row = mysql_fetch_assoc($result)) {

       $id = $row['id'];
       $student_id=htmlentities($row['student_id']);

        $hashed_password=htmlentities($row['hashed_password']);
        $name=htmlentities($row['name']);
        $email=htmlentities($row['email']);
$tabledata.="<tr id='$id' class='edit_tr'><td class='edit_td' >
    <span id='one_$id' class='text'>$student_id</span>
    <input type='text' value='$student_id' class='editbox' id='one_input_$id' />
    </td>

    <td class='edit_td' >
    <span id='two_$id' class='text'>$hashed_password</span> 
    <input type='text' value='$hashed_password' class='editbox' id='two_input_$id'/>
    </td>

    <td class='edit_td' >
    <span id='three_$id' class='text'>$name $</span> 
    <input type='text' value='$name' class='editbox' id='three_input_$id'/>
    </td>

    <td class='edit_td' >
    <span id='four_$id' class='text'>$email $</span> 
    <input type='text' value='$email' class='editbox' id='four_input_$id'/>
    </td>

    <td><a href='#' class='delete' id='$id'> X </a></td>

    </tr>";
    }
    $finaldata = "<table width='100%'>". $tablehead . $tabledata . "</table>"; // Content for Data

            }          
            echo "</div>";

    ?>
<EditDeletePage.js>
$(document).ready(function()
{
$(".delete").live('click',function()
{
var id = $(this).attr('id');
var b=$(this).parent().parent();
var dataString = 'id='+ id;
if(confirm("Sure you want to delete this update? There is NO undo!"))
{
    $.ajax({
type: "POST",
url: "delete_ajax.php",
data: dataString,
cache: false,
success: function(e)
{
b.hide();
e.stopImmediatePropagation();
}
           });
    return false;
}
});


$(".edit_tr").live('click',function()
{
var ID=$(this).attr('id');

$("#one_"+ID).hide();
$("#two_"+ID).hide();
$("#three_"+ID).hide();
$("#four_"+ID).hide();


$("#one_input_"+ID).show();
$("#two_input_"+ID).show();
$("#three_input_"+ID).show();
$("#four_input_"+ID).show();


}).live('change',function(e)
{
var ID=$(this).attr('id');

var one_val=$("#one_input_"+ID).val();
var two_val=$("#two_input_"+ID).val();
var three_val=$("#three_input_"+ID).val();
var four_val=$("#four_input_"+ID).val();

var dataString = 'id='+ ID +'&name='+one_val+'&category='+two_val+'&price='+three_val+'&discount='+four_val;
if(one_val.length>0&& two_val.length>0 && three_val.length>0 && four_val.length>0)
{

$.ajax({
type: "POST",
url: "live_edit_ajax.php",
data: dataString,
cache: false,
success: function(e)
{

$("#one_"+ID).html(one_val);
$("#two_"+ID).html(two_val);
$("#three_"+ID).html(three_val);
$("#four_"+ID).html(four_val);

e.stopImmediatePropagation();

}
});
}
else
{
alert('Enter something.');
}

});

// Edit input box click action
$(".editbox").live("mouseup",function(e)
{
e.stopImmediatePropagation();
});

// Outside click action
$(document).mouseup(function()
{

$(".editbox").hide();
$(".text").show();
});


//Pagination            
function loading_show(){
$('#loading').html("<img src='images/loading.gif'/>").fadeIn('fast');
}
function loading_hide(){
$('#loading').fadeOut('fast');
}                
function loadData(page){
loading_show();                    
$.ajax
({
type: "POST",
url: "load_data.php",
data: "page="+page,
success: function(msg)
{
$("#container").ajaxComplete(function(event, request, settings)
{
loading_hide();
$("#container").html(msg);
});
}
});
}
loadData(1);  // For first time page load default results
$('#container .pagination li.active').live('click',function(){
var page = $(this).attr('p');
loadData(page);
});           
$('#go_btn').live('click',function(){
var page = parseInt($('.goto').val());
var no_of_pages = parseInt($('.total').attr('a'));
if(page != 0 && page <= no_of_pages){
loadData(page);
}else{
alert('Enter a PAGE between 1 and '+no_of_pages);
$('.goto').val("").focus();
return false;
}
});
});